Sri Lanka's parliament votes Wednesday for a president to replace Gotabaya Rajapaksa, who fled abroad last week after his palace was stormed by angry protesters now bracing for a crackdown from his likely successor.

The winner of the three-way contest to succeed him will take charge of a bankrupt nation that is in bailout talks with the IMF, with its 22 million people enduring severe shortages of food, fuel and medicine.

Analysts say the frontrunner is Ranil Wickremesinghe, a six-time former prime minister who became acting president after his predecessor resigned, but is despised by the protesters who see him as a Rajapaksa ally.

A demonstrator displays a headband with a slogan against interim Sri Lankan President Ranil Wickremesinghe during a demonstration near the Presidential secretariat in Colombo on July 17, 2022.
A demonstrator displays a headband with a slogan against interim Sri Lankan President Ranil Wickremesinghe during a demonstration near the Presidential secretariat in Colombo on July 17, 2022. AFP / Arun SANKAR

Months of demonstrations over an unprecedented economic crisis culminated in Rajapaksa announcing his resignation from Singapore last week, days after troops rescued the leader from his besieged compound.

His departure wounds a once-powerful ruling clan that has dominated Sri Lankan politics for most of the past two decades, after his brothers also quit their posts as premier and finance minister earlier this year.

Wickremesinghe, 73, has the backing of the Rajapaksas' SLPP, the largest bloc in the 225-member parliament, for Wednesday's secret ballot.

Ranil Wickremesinghe, seen here in 2020, is likely to crack down on demonstrators if he wins the presidency and they protest against him, analysts have said
Ranil Wickremesinghe, seen here in 2020, is likely to crack down on demonstrators if he wins the presidency and they protest against him, analysts have said AFP / Ishara S. KODIKARA

As acting president, Wickremesinghe has extended a state of emergency that gives police and security forces sweeping powers, and last week he ordered troops to evict protesters from state buildings they had occupied.

An opposition MP said Wickremesinghe's hardline stance against demonstrators was going down well with MPs who had been at the receiving end of mob violence, and most SLPP legislators would side with him.

"Ranil is emerging as the law-and-order candidate," Tamil MP Dharmalingam Sithadthan told AFP.

Graphic on the three candidates nominated for for Sri Lanka's presidential ballot on Wednesday.
Graphic on the three candidates nominated for for Sri Lanka's presidential ballot on Wednesday. AFP / STAFF

Political analyst Kusal Perera agreed Wickremesinghe had a "slight advantage", despite his own party securing just one seat at the August 2020 elections.

"Ranil has regained the acceptance of the urban middle classes by restoring some of the supplies like gas and he has already cleared government buildings showing his firmness," Perera said.

Intense lobbying on Wednesday evening saw two smaller parties pledge their support to Wickremesinghe's main challenger, and the final contest appears to be close.

Demonstrators shout slogans against interim Sri Lanka President Ranil Wickremesinghe during a protest in front of the Fort railway station in Colombo on July 19, 2022
Demonstrators shout slogans against interim Sri Lanka President Ranil Wickremesinghe during a protest in front of the Fort railway station in Colombo on July 19, 2022 AFP / Arun SANKAR

Observers believe that Wickremesinghe will crack down hard if he wins and the demonstrators -- who have also been demanding his resignation, accusing him of protecting the Rajapaksas' interests -- take to the streets.

Former president Mahinda Rajapaksa, the deposed Gotabaya's elder brother and head of the clan that has dominated Sri Lankan politics for years, remains in the country, and party sources said he was pressing SLPP legislators to support Wickremesinghe.

His main opponent in the vote will be SLPP dissident and former education minister Dullas Alahapperuma, a former journalist who is being supported by the opposition.

Alahapperuma pledged this week to form "an actual consensual government for the first time in our history".

If he wins, the 63-year-old is expected to name opposition leader Sajith Premadasa as his prime minister. Premadasa's late father Ranasinghe ruled the country with an iron fist in the 1980s, when Alahapperuma was a rights campaigner.

The third candidate is Anura Dissanayake, 53, leader of the leftist People's Liberation Front (JVP), whose coalition has three parliamentary seats.

Lawmakers will rank the candidates in order of preference in a secret ballot -- a mechanism which gives them a freer hand than an open poll, and previous elections have seen allegations of bribes offered and accepted in exchange for votes.

Candidates need more than half the vote to be elected. If no one crosses the threshold on first preferences, the candidate with the lowest support will be eliminated and their votes distributed according to second preferences.

The new leader will be in office for the balance of Rajapaksa's term, which runs until November 2024.

If Wickremesinghe is confirmed in the post, he is expected to name public administration minister Dinesh Gunawardena, 73, his schoolmate and a strong Rajapaksa loyalist, as the new premier.