COLOMBO, Sri Lanka — The fate of President Gotabaya Rajapaksa, whose family has dominated politics in Sri Lanka for much of the past two decades, was uncertain on Saturday after protesters stormed his residence and offices and sent him into hiding, and the nation’s political leaders asked him to step down.
The call for Mr. Rajapaksa’s departure, confirmed by lawmakers, was the culmination of months of public pressure and protest, with thousands of people on Saturday braving police curfew, fuel shortage and even the halting of public trains to descend on the capital, Colombo, to register their growing fury over the government’s inability to address a crippling economic crisis.
Sri Lanka has run out of foreign-exchange reserves for imports of essential items like fuel and medicine, and the United Nations has warned that more than a quarter of Sri Lanka’s 21 million people are at risk of food shortages. The protesters blame the Rajapaksas, who increasingly ran the government like a family business, for their misery.
The country’s downward spiral has played out as high energy prices and food inflation has afflicted much of the world. Russia’s invasion of Ukraine, and the sanctions that followed, have sent energy prices flying, while global food supply chains are increasingly dwindling under stress and demand.
The small island nation has also long been a nexus for geopolitical competition and intrigue, with both China and India jostling for influence.
The rise of the Rajapaksas coincided with China’s emergence as a willing lender. The family took large loans from Chinese banks for vanity construction projects with questionable economic logic, including a port project at Hambantota that left the country desperately in debt. In recent months, however, as the economy crashed, Chinese assistance has been lacking, and Sri Lanka has relied on credit lines and financial aid from India.
In Sri Lanka, the daily reality of people’s lives has grown only harsher in recent weeks, with extreme shortages of fuel and essential medicine. Citizens have lined up at gas stations, often in vain. Local news media have reported the deaths of at least 15 people in fuel lines, from heatstroke and other causes, since the beginning of the crisis.
Saturday’s march on Colombo was the largest so far in the months of protest, which has included a continuous protest camp outside the presidential secretariat, which houses his office, for about 100 days.
The police used tear gas and water cannons against protesters and fired shots into the air to try to disperse them, leaving at least 42 people injured. But the numbers were such that the protesters soon breached the gates of the presidential residence as well as the presidential secretariat.
Videos on social media showed protesters jumping into the pool in Mr. Rajapaksa’s residence, resting in bedrooms, and frying snacks in the presidential kitchen.
“I came here today to send the president home,” said Wasantha Kiruwaththuduwa, 50, who had walked 10 miles to join the protest. “Now the president must resign. If he wants peace to prevail, he must step down.”
The whereabouts of Mr. Rajapaksa was not clear, as the government appeared in total chaos. For months, he has wildly maneuvered to stay in power for at least the remaining two years of his turn. Now, he stands at the brink of an ouster that would forever mark the legacy of his powerful family.
By nightfall, the prime minister, Ranil Wickremesinghe, announced that he would be resigning to open way for an “all-party government.” Mr. Wickremesinghe, a veteran politician who has served as prime minister nearly a dozen times, was trying to raise financial aid from allied countries and work with the International Monetary Fund to restructure the country’s immense foreign debt.
The political crisis escalated earlier this year as the devastating consequences of the government’s mismanagement of the economy started to hit harder than ever, with fuel running out and food running short.
Among Mr. Rajapaksa’s faulty policies was broad tax cuts upon taking office in 2019, which shrunk government revenues, and the sudden ban on chemical fertilizer to push the country toward organic farming, which reduced harvests. The pandemic lockdowns only further devastated the economy, depriving it of crucial tourist dollars.
As protests intensified in the spring, Mr. Rajapaksa tried to offer incremental compromises by forcing some members of his cabinet to resign while shuffling others to new roles.
But protesters wanted the whole government to go, and the president was struggling to convince his elder brother and prime minister, Mahinda Rajapaksa, to give up his seat.
In May, Mahinda Rajapaksa was forced out as prime minister, but only after a large group of his supporters marched out of his residence and attacked the camps of peaceful protesters. The clashes unleashed a wave of violence and vandalism across the country, raising fears that the country could break into outright anarchy. The prime minister fled to a military base in the middle of the night.
If the president yields to pressure to step down, it will mark another dramatic turn in a family power dynasty that has been so defining in Sri Lankan affairs.
During his decade as president, between 2005 and 2015, Mahinda Rajapaksa ended the country’s three-decade civil war by quashing the Tamil Tigers’ insurgency through brutal military force, in a campaign that led to accusations of widespread human rights abuses. His brother, Gotabaya, then served as his powerful defense secretary.
The Rajapaksas were briefly out of the government, but returned to power resoundingly in 2019. That election campaign mixed nationalist appeals to the Buddhist Sinhalese, the majority ethnic group in Sri Lanka, and portrayals of Gotabaya Rajapaksa as the strongman the country needed after the deadly terror attacks on Easter Sunday just months before the elections.
Soon after, he brought his older brother, Mahinda, back to the government as prime minister and handed critical positions to several other members of the family.
The economic crisis is a major setback for the nation, which was still grappling with the legacy of the bloody three-decade civil war. That conflict, between the government and the Tamil Tiger insurgents who had taken up the cause of discrimination against the ethnic minority Tamils, ended in 2009. But many of its underlying causes have remained, with the Rajapaksa family continuing to cater to the majority Buddhist Sinhalese.
Skandha Gunasekara reported from Colombo, and Mujib Mashal from New Delhi.