COLOMBO, July 19 (AFP) - Sri Lanka's parliament votes on Wednesday (Jul 20) 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 International Monetary Fund (IMF), with its 22 million people enduring severe shortages of food, fuel and medicine.

Analysts say that 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.

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 prime minister 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.

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 member of parliament said that 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.

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

"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.

Observers believe that Wickremesinghe will crack down hard if he wins and that demonstrators - who have also been demanding his resignation, accusing him of protecting the Rajapaksas' interests - will 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 that he was pressing SLPP legislators to support Wickremesinghe.