Sri Lanka is at a crossroads as an economic crisis upends the lives of its 22 million people. The Rajapaksa brothers, hailed by many as heroes for winning the civil war, are now reviled as leaders. How did this happen and what comes next?
Since early April protesters had been demanding that President Gotabaya Rajapaksa and Mahinda, his prime minister, quit for leading the country to economic ruin - but this week saw a decisive turning point.
First, Mahinda Rajapaksa resigned after his supporters attacked anti-government protesters, triggering deadly clashes across the country. Dozens of houses of politicians were torched, including some owned by the Rajapaksas.
Mr Rajapaksa, 76, had to be evacuated from his official residence after it was besieged by angry crowds.
He's holed up in a naval base in the north-east for his safety. A court has banned him from leaving the country - utter humiliation for a man who was twice president.
His departure has done nothing to ease the growing pressure on his beleaguered younger brother, 72.
So far the president has ignored the calls to quit, although he has now been forced to offer some concessions. He agreed to transfer some his executive powers to parliament, and has appointed political veteran Ranil Wickremesinghe as the new prime minister heading a proposed cross-party government.
But his political future is very much still on the line, and some believe it's only a matter of time before he's forced to go.
Sri Lanka can scarcely afford further political instability as it stares at its worst economic crisis since independence from Britain. People are seething with anger over soaring prices and shortages of food and fuel.
It's a dramatic fall from grace for a family that has dominated Sri Lankan politics for more than a decade.
Mahinda Rajapaksa was once celebrated by the majority Sinhalese as a hero for bringing an end to nearly three decades of civil war when the Tamil Tiger rebels were crushed in 2009 during his first term as president.
At victory parades and mass public events soon after the war he was compared to Sinhala Buddhist kings.
"He was the most popular Sinhala Buddhist leader in post-independence Sri Lanka. Some even hailed him as Emperor Mahinda," says veteran political analyst Kusal Perera.
In his 2017 book Rajapaksa: The Sinhala Selfie, Mr Perera highlights the Rajapaksa family's role in the island's politics and how Mahinda groomed himself for power.
His father was a parliamentarian and Mahinda gradually rose from opposition leader in parliament to prime minister in 2004.
When he became president a year later, he made Gotabaya defence secretary. It was a big career jump for the younger brother who was living a quiet life in the US after retiring from the Sri Lankan military.
Gotabaya came back for his brother's campaign and rose to prominence, earning a reputation for ruthlessness.
Soon, other brothers and relatives joined the government. It was Mahinda, the family patriarch, who was instrumental in establishing the Rajapaksa empire.
Up to now the brothers have always stood together. But cracks started appearing recently, especially after Gotabaya asked Mahinda to "take one for the team" and heed protesters' calls to resign.
The demand was a huge snub for a man who brought his younger brother into government - and certainly not the way he wanted to end his political career.
"He was basically pushed to the wall and forced to leave in a huge youth protest that he fumbled in handling. His age will hold against his return," Mr Perera says.
Mahinda's eldest son, Namal, denies the brothers have a problem.
"But definitely there is a policy difference between the president and the [former] prime minister," he told the 365Nainanews before this week's resignation.
He said his father had been always with the farmers and the masses, whereas Gotabaya Rajapaksa had a different approach "looking more into the floating vote rather than the masses or hardcore SLPP [governing party] vote".
Protesters may be glad Mahinda Rajapaksa has resigned, but they remain determined Gotabaya must do so too, something his supporters rule out.
"Just because there's chaos outside - for which there are very valid reasons, we all agree - that does not necessarily mean that he should resign," former media minister Nalaka Godahewa told the 365Nainanews.
It's not clear what the president will do now he has lost the support of the voters that swept him to power in 2019.
Mr Rajapaksa has reportedly told people close to him that he's not interested in a second term but wants to lead the country out of the economic crisis.
With anti-Rajapaksa sentiment widespread in the country, his options to do that seem limited. Backed into a corner, there are concerns the president, known for his tough approach, could try to use the military to stay in power.
The Rajapaksas were hugely popular among the Sinhala masses for years, despite allegations of serious human rights abuses, ill-treatment of minorities and murderous attacks on the media, for which they were blamed. Most among the Sinhala majority did not speak out then.
But now the whole country is suffering, the cost-of-living protest has united ethnic communities and Sinhalese protesters are even voicing support for minority rights.
"The economic hardship really hit the majority community and suddenly they turned. I think the Rajapaksas who were able to get away with so much for decades were surprised to see this level of anger," says Bhavani Fonseka, a human rights lawyer.
But the Rajapaksas will not be willing to give up control that easily. They are concerned not only about their political future, but also about their security when a new government takes over.
This might explain the appointment of veteran opposition figure Ranil Wickremesinghe as the next prime minister. He is regarded as having good relations with the Rajapaksas.
Many Sri Lankans, however, are frustrated by the president's manoeuvring, and are losing patience.
Without stable government it will be difficult to negotiate a loan with the International Monetary Fund or restructure debt. But if the next government doesn't do that soon, there will be more power cuts and fuel shortages.
"Regardless of who runs this country, we just need our basic needs to be met," says Chandani Manel, who lives in Colombo.
"I have two children to feed and a family to look after. Politicians can survive with their wealth but not us," she says.