Sri Lanka struck a $2.9 billion bailout deal with the International Monetary Fund on Thursday, a key hurdle in the government's efforts to overcome a painful and unprecedented economic crisis.
The island nation of 22 million people has suffered months of blackouts as well as acute food, fuel and medicine shortages.
Tens of thousands of people have protested against the government's handling of the crisis, aggravated by the loss of tourist revenue during the Covid-19 pandemic.
At the peak of the demonstrations, an angry crowd stormed former leader Gotabaya Rajapaksa's house and forced the then-president to flee the country.
His successor Ranil Wickremesinghe has cracked down hard on demonstrations and introduced sweeping economic reforms in an effort to repair the nation's shattered finances.
AFP looks at how the crisis unfolded:
- April 1: State of emergency -
President Gotabaya Rajapaksa declares a state of emergency after clashes between police and hundreds of demonstrators demanding his resignation outside his residence in the capital Colombo.
- April 3: Cabinet resigns -
Most of the cabinet resigns at a late-night meeting two days later, leaving Rajapaksa and his brother Mahinda -- the prime minister -- isolated.
The central bank governor quits a day later.
- April 5: President loses majority -
Finance minister Ali Sabry resigns just a day after being appointed.
The president then loses his parliamentary majority as former allies urge him to quit. He lifts the state of emergency.
- April 12: Foreign debt default -
The government announces it is defaulting on its foreign debt of $51 billion.
- April 19: First casualty -
Police kill a protester, the first casualty after several weeks of anti-government protests.
The next day, the IMF says it has asked Sri Lanka to restructure its colossal external debt before a rescue package can be agreed.
- May 9: Day of violence -
A mob of government loyalists bussed in from the countryside attacks peaceful protesters camped outside the president's office.
Nine people are killed and hundreds more injured in reprisal attacks.
Mahinda Rajapaksa resigns as prime minister and has to be rescued by troops after thousands of protesters storm his official residence in Colombo.
He is replaced by Ranil Wickremesinghe, a political veteran also deeply unpopular among the protesters.
- June 10: Humanitarian crisis -
The United Nations warns that Sri Lanka is facing a dire humanitarian crisis, with millions already in need of aid.
More than three-quarters of the population had reduced their food intake due to severe food shortages, it says.
- July 9: President's home stormed -
Rajapaksa flees his official residence with the assistance of troops, shortly before demonstrators storm the compound.
Wickremesinghe's home is torched by protesters.
- July 13: President flees country -
Rajapaksa flies to the Maldives on a military aircraft, accompanied by his wife and two bodyguards.
Six-time premier Wickremesinghe is appointed as acting president.
The government declares a state of emergency.
- July 14: Rajapaksa resigns -
Rajapaksa leaves the Maldives for Singapore.
On arrival, he emails his resignation as president to the parliamentary speaker.
- July 20: Wickremesinghe elected president -
Wickremesinghe beats two opponents to be elected president by parliament for the remainder of Rajapaksa's term, which expires in November 2024.
The 73-year-old begins a crackdown on demonstrators, with security forces dismantling a protest camp near the president's office and arresting prominent activists.
Wickremesinghe also embarks on a reform programme to meet IMF conditions for a bailout, raising taxes and hiking the cost of fuel and utilities.
- September 1: Bailout deal -
The IMF announces a four-year, $2.9 billion bailout package, conditional on a deal between the government and its creditors to restructure its borrowings.
The agreement still needs approval by the lender's board, and is lower than the $3-4 billion sought by Sri Lanka, but is an important first step in restoring public finances.
Peter Breuer, the IMF's head of mission, urges creditors to cut a deal with the island nation or risk deepening the ongoing crisis.