Acting Sri Lankan President Ranil Wickremesinghe is favourite to take the country's reins long term on Wednesday, as parliament votes to appoint a full successor to Gotabaya Rajapaksa.

Wickremesinghe, a six-time former prime minister, has the backing of Rajapaksa's Sri Lanka Podujana Peramuna (SLPP), the largest bloc in the 225-member legislature.

Victory would be the fulfilment of a lifelong ambition for the veteran politician, who is currently head of state in an acting capacity after Rajapaksa resigned in disgrace, fleeing to Singapore and leaving his country in economic ruin.

The pro-Western Wickremesinghe has sought the position for decades.

A few families have long dominated politics in the Indian Ocean island nation, and Wickremesinghe is the nephew of one its longest-serving leaders, Junius Jayewardene, who was in power for 12 years until stepping down in 1989.

Dubbed the "old fox", Jayewardene was renowned for his cunning, but his nephew is regarded as an even shrewder navigator of the country's internecine power networks.

It was Jayewardene who brought him into politics by making him a deputy foreign affairs minister in 1977. Commentators joked the initials of their United National Party (UNP) actually stood for Uncle and Nephew.

Family members say that Jayewardene, who died in 1996, had wanted to ensure that Wickremesinghe becomes president "even for one day".

On Friday, Wickremesinghe became acting president, stepping up from his position as prime minister as dictated by Sri Lanka's constitution.

He had only been appointed to that role in mid-May, when Gotabaya's elder brother Mahinda resigned due to widespread protests against the Rajapaksas' rule, as the country faced its worst-ever economic crisis.

Wickremesinghe has run for the presidency twice before -- in 1999 and 2005 -- losing both elections, and the UNP was annihilated in a parliamentary election in 2020, leaving the silver-haired veteran as its only MP.

His political manoeuvring, however, has seen him outfox opponents and emerge as the frontrunner for the presidency.

But while he has the official backing of the largest party in parliament, the demonstrators who ousted Rajapaksa are also demanding his departure, accusing him of protecting the ex-president's family's interests.

Analysts say he will crack down hard if he is elected and protesters take to the streets against him.

Wickremesinghe is married to Maithree, an English lecturer. They do not have children and have bequeathed their assets to his old school and their universities.

Ranil Wickremesinghe ia head of state in an acting capacity after Gotabaya Rajapaksa resigned in disgrace
Ranil Wickremesinghe ia head of state in an acting capacity after Gotabaya Rajapaksa resigned in disgrace AFP / Ishara S. KODIKARA

But their impressive library of more than 2,500 books -- which he called his "biggest treasure" -- was among the losses when their house was torched by demonstrators who also drove Rajapaksa from his official residence.

Born into a wealthy and politically connected family rooted in publishing and plantations, Wickremesinghe started work as a rookie reporter at one of the family newspapers.

He turned to a legal career after the family firm was nationalised in 1973 by Sirima Bandaranaike, the world's first woman prime minister.

"If Lake House had not been taken over, I would have become a journalist. So actually, Mrs Bandaranaike sent me to politics," Wickremesinghe once told AFP.

His first appointment as prime minister was as a result of the May 1993 assassination of president Ranasinghe Premadasa by a suicide bomber.

The then-premier Dingiri Banda Wijetunga was elevated to the presidency, and picked Wickremesinghe -- then Industry, Science and Technology minister -- to replace him.

A similar attack arguably denied him the presidency six years later: his main election rival Chandrika Kumaratunga was wounded by a suicide bomber just three days before the polls.

She brought the nation to tears in a television appearance with a patch over the right eye she had lost and received a significant sympathy vote, with Wickremesinghe losing an election many thought he would win.

Now the political wheel may turn once more: Premadasa's son Sajith is now the leader of the opposition and has backed Wickremesinghe's main rival for the presidency, Dullas Alahapperuma.

Wickremesinghe long had a relatively clean image in Sri Lanka's often corrupt politics, but it was muddied during his last-but-one prime ministerial term in 2015-19, when his administration was rocked by an insider trading scam involving central bank bonds.

His schoolmate and choice as central bank chief was a key accused, raising allegations of cronyism.

Wickremesinghe was also accused of protecting members of the Rajapaksa clan who have been accused of graft, kickbacks, siphoning off public finances and even murder.

As acting president, he took charge of a bankrupt nation that has defaulted on its $51-billion foreign debt and lacks the money to import essential goods.

His status as a pro-Western, free-market reformist could smooth bailout negotiations with the International Monetary Fund and foreign creditors, but he has already warned there will be no quick fix to the nation's unprecedented economic woes.

"The worst is yet to come. We have very high inflation now and hyperinflation is on its way," Wickremesinghe told parliament earlier this month. "We are bankrupt."