OREANDA-NEWS  President Gotabaya Rajapaksa of Sri Lanka, who fled his country early Wednesday after months of fervent protests blaming him for the country’s economic collapse and widespread hardship, officially resigned on Thursday, setting off celebrations in his homeland.

Mr. Rajapaksa submitted his resignation by email from Singapore where he traveled after first fleeing to the Maldives. Mr. Rajapaksa went into hiding on Saturday as demonstrators stormed his official residence in Colombo, the Sri Lankan capital, before leaving the country on Wednesday.

Even as news that the president had stepped down filtered out, the protest movement that forced out the island nation’s powerful political dynasty over the country’s financial ruin largely continued as it has for months. Speeches and music blared from a main stage in Colombo, while protesters strategized in tents dotting the scenic seaside.

In another corner, tempers flared. A large number of protesters clashed with security forces overnight, seizing the weapons of at least two soldiers, as they tried to force their way into the Parliament, the focus for what appears to be a protracted political crisis.

Activists on Thursday were struggling to keep things calm and ensure that a mass citizens’ movement does not help tip a country still grappling with the legacy of a decades-long civil war into outright anarchy. Over the three months of protest, they have doggedly protected their reputation as a peaceful movement. But the political elite’s infighting over the vacuum of power left by the fleeing of President Gotabaya Rajapaksa now tests their patience.

In an effort to reduce tensions, protest organizers on Thursday announced that they were pulling out of most government buildings that they had occupied, including the presidential mansion. They have taken care to keep the historic buildings intact, assigning volunteers to clean up after the hordes of visitors and discouraging rowdy youngsters from climbing the mango trees in the garden or damaging the antique furniture.

“We are moving out of the occupied buildings because we want to preserve these places, and we don’t want people to vandalize these places, nor do we want the state or other actors using vandalism as a reason to vilify us and the movement,” said Buwanaka Perera, an organizer of the protest camp that has operated for more than three months in an oceanside park.

“So it’s better to hand it over to the state,” Mr. Perera said. “The state of Sri Lanka, not the president, not the prime minister, but the state.”

Mr. Rajapaksa had refused an orderly transition of power in the face of mounting protests, but is now handing over the reins to the deeply unpopular Prime Minister Ranil Wickremesinghe. Succession plans had been complicated without Mr. Rajapaksa’s resignation, which he had promised to submit on Wednesday and ends his time in office.

Protesters blame the Rajapaksa dynasty for the mismanagement of the country’s economy, which is essentially out of money and running low on fuel, food and essential medicine.

Protests followed Mr. Rajapaksa to the Maldives as well. In the capital, Mal?, around 100 Sri Lankan migrant workers gathered, carrying signs and placards urging officials not to protect him. “Dear Maldivian friends, please urge your government not to safeguard criminals,” read one banner. “Throw him out of here,” read another.