The Sri Lankan speaker of parliament accepted a resignation letter from President Gotabaya Rajapaksa, having verified its authenticity after it was flown from Singapore late on Thursday, he told reporters.
Rajapaksa fled the country Wednesday amid protests and calls for his resignation. He initially fled to the Maldives and arrived in Singapore on Thursday.
"I have accepted the resignation. From this point, we will move to constitutionally appoint a new president," the speaker, Mahinda Yapa Abeywardena, said on Friday. The process to find a new president would take seven days, he added.
The news of Rajapaksa's resignation was first sent by e-mail to the speaker before a hard copy was delivered to the speaker.
What is happening with protests in Sri Lanka?
"To be validated like this is massive. On a global scale, we have led a movement that toppled a president with minimal force and violence. It's a mix of victory and relief," Viraga Perera, a protester, told the AP news agency.
In Colombo, crowds celebrated the resignation with firecrackers, dancing, and sloganeering. Protests over the situation and dire shortages of necessities have been going on for months. Last week, groups of protesters stormed the president and prime minister's residences.
Demonstrators on Thursday left several of the buildings they had occupied after Prime Minister Ranil Wickremesinghe instructed security forces to restore order.
A curfew imposed in the area on Thursday was lifted early on Friday, police spokesman Nalin Thalduwa said.
Police said a soldier and a constable were injured in clashes with protesters outside the national parliament as security forces beat back an attempt to storm the legislature. Protesters also left the studios of the main state television station after breaking in on Wednesday.
The military and the police were issued fresh orders Thursday to firmly put down any violence, and warned troublemakers they were "legitimately empowered to exercise their force."
What will happen next?
As per the constitution, Wickremesinghe will automatically become acting president until parliament can elect a member of parliament to succeed Rajapaksa for the rest of his term. Protesters have also been calling for the resignation of Wickremesinghe.
The new president could potentially appoint a new prime minister, who would then have to be approved by parliament.
Singapore's Foreign Ministry confirmed Rajapaksa had been allowed to enter the city-state. "He has not asked for asylum and neither has he been granted any asylum," said the ministry.
Rajapaksa is expected to look to stay in Singapore for some time, according to Sri Lankan security sources, the AFP news agency reported. He could potentially move to the United Arab Emirates.
Sri Lanka had begun preliminary discussions with the International Monetary Fund about a potential bailout loan. But the recent upheaval has disrupted talks.
IMF spokesman Gerry Rice told reporters on Thursday that Fund's staff were still in contact with technical-level government officials but hoped to resume high-level dialogue "as soon as possible."