COLOMBO, Sri Lanka (AP) -- Sri Lanka's prime minister agreed to resign on Saturday after party leaders in Parliament demanded both he and the embattled president step down on the day protesters stormed the president's residence and office in a fury over a worsening economic crisis.
The prime minister's spokesman, Dinouk Colambage, said Ranil Wickremesinghe told party leaders that he will resign when all parties have agreed on a new government.
His decision came after the biggest protest yet swept Sri Lanka as tens of thousands of people broke through barricades and entered President Gotabaya Rajapaksa's residence and nearby office to vent their anger against a leader they hold responsible for the nation's worst crisis.
Footage showed people taking a dip in the garden pool of the residence and others in a jubilant mood.
Rajapaksa appointed Wickremesinghe as prime minister in May in the hope that the career politician would use his diplomacy and contacts to resuscitate a collapsed economy. But people's patience wore thin as shortages of fuel, medicine and cooking gas only increased and oil reserves ran dry.
Many protesters accuse Wickremesinghe of trying to save Rajapaksa when he came under pressure to resign, as every other member of his powerful political dynasty had quit the Cabinet.
Opposition parties in Parliament were currently in discussion about forming an all-party government.
It was not clear if Rajapaksa was inside his residence when it was stormed earlier Saturday. A government spokesman, Mohan Samaranayake, said he had no information about Rajapaksa's whereabouts.
Leaders of political parties in Parliament met later and decided to request Rajapaksa and Wickremesinghe to step down, opposition lawmaker Rauff Hakeem said on Twitter. He said a consensus was reached that the parliamentary speaker should take over as temporary president and work on an interim government.
Sri Lanka's economy is in a state of collapse, muddling through with aid from India and other countries as its leaders try to negotiate a bailout with the International Monetary Fund. The economic meltdown has led to severe shortages of essential items, leaving people struggling to buy food, fuel and other necessities.
The turmoil has led to months of protests, which have nearly dismantled the Rajapaksa political dynasty that has ruled Sri Lanka for most of the past two decades.
The president's older brother resigned as prime minister in May after violent protests saw him seek safety at a naval base. Much of the public ire has been pointed at the Rajapaksa family, with protesters blaming them for dragging Sri Lanka into chaos with poor management and allegations of corruption.
Videos posted on social media showed protesters storming the residence, chanting "Gota go home," calling the president by his nickname. Dozens were seen jumping into the pool, milling about the house and and watching television. Outside the building, barricades were overturned and a black flag was hoisted on a pole.
At the president's office, security personnel tried to stop demonstrators who pushed through fences to run across the lawns and inside the colonial-era building.
At least 34 people including two police officers were wounded in scuffles as protesters tried to enter the residence. Two of the injured are in critical condition while others sustained minor injuries, said an official at the Colombo National Hospital who spoke on condition of anonymity as he was not authorized to speak to the media.
Thousands of protesters entered the capital from the suburbs after police lifted an overnight curfew. With fuel supplies scarce, many crowded onto buses and trains to come to the city to protest, while others made their way on bicycles and on foot.
Protest and religious leaders called on Rajapaksa to step down, saying he has lost the people's mandate.
"His claim that he was voted in by the Sinhala Buddhists is not valid now," said Ven. Omalpe Sobitha, a prominent Buddhist leader. He urged Parliament to convene immediately to select an interim president but said that Wickremesinghe did not enjoy the people's support.
Last month, Wickremesinghe said the country's economy has collapsed. He said that the negotiations with the IMF have been complex because Sri Lanka was now a bankrupt state.
In April, Sri Lanka announced it is suspending repaying foreign loans due to a foreign currency shortage. Its total foreign debt amounts to $51 billion of which it must repay $28 billion by the end of 2027.
Police had imposed a curfew in Colombo and several other main urban areas on Friday night but withdrew it Saturday morning amid objections by lawyers and opposition politicians who called it illegal.
U.S. Ambassador to Sri Lanka Julie Chung on Friday asked people to protest peacefully and called for the military and police "to grant peaceful protesters the space and security to do so."
"Chaos & force will not fix the economy or bring the political stability that Sri Lankans need right now," Chung said in a tweet.