Former Bangladeshi military ruler H.M. Ershad, whose Jatiya Party is a key ally of the ruling Awami League, took oath on Saturday as a lawmaker despite his earlier decision to boycott the general election.

His earlier decision had triggered speculation that Mr. Ershad might not serve as a lawmaker despite his election from a seat in Rangpur, and his wife Raushan may head the party in parliament.

Speaker Shirin Sharmin Chaudhury administered the oath to the 83-year-old Jatiya Party chairman just past midday.

Ershad has played flip-flop before the January 5 polls, first agreeing to contest them and then saying he was boycotting them a day after submitting his nomination papers.

In a dramatic episode before the polls, the former dictator-turned-politician was brought to the military hospital for “treatment.”

He has been in the military hospital since December 12.

The Election Commission had declined to accept his plea, sent from hospital, to withdraw his candidature.

The Jatiya Party won 33 seats — 20 without any contest — in the polls boycotted by the Bangladesh Nationalist Party-led opposition alliance.

Mr. Ershad on Saturday evaded media after he was sworn in, two days after his fellow party MPs took oath under the leadership of Ms. Raushan.

Witnesses said he entered parliament through a route used by the President, Prime Minister and Deputy Leader of the House.

No Jatiya Party leader was seen accompanying Mr. Ershad as he came out of hospital, where he was being treated to “regain his fitness”, to go to parliament.

Earlier, Ms. Raushan said she would function as opposition leader, fuelling speculation about the stand of her husband.