Malaysia’s leader in waiting Anwar Ibrahim returned to parliament as a lawmaker Monday, and vowed to give former nemesis Prime Minister Mahathir Mohamad space to get on with running the country.

MPs applauded as Anwar took the oath of office following his weekend local election victory, a sight that would have been unthinkable just months ago when he was an opposition leader languishing behind bars.

The former deputy premier’s remarkable political resurrection was triggered by his alliance’s shock election victory in May, which toppled a corruption-riddled coalition that had ruled Malaysia for six decades.

Following the triumph, Anwar was pardoned and released from jail, where he had been imprisoned since 2015 on widely criticised sodomy charges, and is now the presumptive successor to the country’s leadership.

Mahathir, 93, has pledged to hand power to Anwar within two years.

‘Unlikely alliance’

The deal was struck when the pair, whose up-and-down relationship has long loomed over Malaysian politics, formed an unlikely alliance to take on the government of Najib Razak.

Anwar needed to be elected as an MP again to succeed Mahathir, and he cruised to a thumping victory in Saturday’s poll in Port Dickson, where his opponents included a former aide whose sodomy accusations landed him in jail.

It is the first time that Mahathir – who, during a first stint as premier, sacked Anwar and had him thrown in jail – and his former foe have been in the same government since the 1990s.

Anwar, wearing a traditional black Muslim cap, brushed aside questions about when he will become premier.

“That’s very important because some of the decisions that have to be made by the prime minister and the cabinet are key, fundamental decisions of policy,” the 71-year-old told reporters.

After their fallout, Anwar became a prominent opposition leader at the head of a reformist alliance. But Mahathir himself turned on the party he once headed as corruption allegations mounted against Najib, and later teamed up with Anwar.

Since his defeat, Najib has been charged over the alleged plundering of state fund 1MDB. He denies any wrongdoing.