Sri Lanka's parliament elected six-time prime minister Ranil Wickremesinghe as the crisis-wracked country's new president Wednesday.
He replaces Gotabaya Rajapaksa who fled to Singapore and resigned last week after months of protests.
AFP looks at how the bankrupt South Asian nation's economy collapsed, and what could come next as the seasoned Wickremesinghe inherits the complicated, corrupt and often violent political system.
In his acceptance speech, Wickremesinghe on Wednesday urged all parties to sink their differences and join him in pulling the country out of its worst economic crisis since independence from Britain in 1948.
The UN has warned that Sri Lanka is heading for a humanitarian catastrophe with months of food, fuel and medicines shortages beginning to bite.
More than five out of every six families are eating less food, according to the World Food Programme, while schools and non-essential government institutions are closed for weeks to reduce commuting and save fuel.
Motorists queue for hours on the rare occasion petrol or diesel are available, and the country is enduring lengthy power cuts as the government has no money to import oil for generators.
Even according to official figures, inflation has crossed 50 percent.
The coronavirus pandemic devastated both tourism and overseas remittances, two of the country's economic mainstays, with problems exacerbated by policy blunders.
More than half of the country's crops failed after Gotabaya Rajapaksa banned agrochemical imports last year. The ban was lifted after six months, but fertiliser is yet to return.
Sri Lanka declared itself bankrupt in mid-April when the government defaulted on its $51 billion foreign debt.
The pro-West Wickremesinghe has already begun talks with the International Monetary Fund (IMF) and is banking on bilateral aid from Japan, China and India to tide over till a bailout is secured.
While an agreement with the IMF may be months away, Wickremesinghe has said he wants to unveil a new budget for 2022 in August as allocations made last year were totally out of whack.
"The data in the budget for 2022 by the previous government is not credible," Wickremesinghe told parliament earlier this month.
The debt statistics may also have been understated, he added, calling for urgent financial reforms.
He wants to sell off loss-making state enterprises such as the national carrier Sri Lankan Airlines -- which lost nearly $700 million in the first four months of this year alone and has accumulated debts of more than $2 billion.
Despite their differences, Sri Lanka's political parties are united in their support for ongoing talks with the IMF.
Wickremesinghe will appoint a new prime minister who is expected to follow his free-market economic policies and carry out painful reforms.
Some politicians have bitterly opposed harsh IMF prescriptions to cut subsidies and raise taxes, but main political leaders agree that Sri Lanka should bite the bullet and deal with the international lender.
The political crisis interrupted the negotiations, and the IMF said last week that it hoped the unrest would be resolved soon so they could resume.
But no political party in the current parliament has a clear majority.
The mass protest movement that began in April and climaxed with Rajapaksa's expulsion from his palace earlier this month could spell trouble for Wickremesinghe.
The protesters also oppose Wickremesinghe, seeing him as a proxy of the disgraced Rajapaksa clan.
He has declared a state of emergency and drawn a distinction between "protesters" and "rioters", vowing to take a tough line against troublemakers.
For their part, the protesters have vowed to maintain their efforts to force Wickremesinghe from office, but most admit that they have run out of steam and public support was waning.
When university students at the forefront of the struggle called for a march in Colombo Tuesday, fewer than 1,000 people turned up, with police estimating the numbers at only a few hundred.
A campaign to surround the national parliament and block Wednesday's vote also fizzled out as no one turned up.
"We supported the struggle, but after getting rid of the Rajapaksa family there is no point in continuing it and causing disruptions," a doctor at the national hospital told AFP, asking not to be named.