Gotabaya Rajapaksa, president of Sri Lanka, says he would step down from office on July 13.
Mahinda Yapa Abeywardena, speaker of the parliament, said the president informed him of his intention to resign.
His decision is coming hours after thousands of protesters had besieged his official residence in Colombo.
The protesters also set ablaze the home of Ranil Wickremesinghe, prime minister of the country, in the nation’s capital city.
An official from Wickremesinghe’s office told the BBC that “protesters have broken into the private residence of Prime Minister Ranil Wickremesinghe and have set it on fire”.
The nation is facing its worst economic crisis since gaining independence from Britain in 1948. Since April, there have been protests over rising prices and power cuts.
The prime minister had also agreed to step aside after party leaders in parliament demanded his resignation and that of the president.
However, Wickremesinghe said he will resign when all parties agree on a new government.
“Today in this country we have a fuel crisis, a food shortage, we have the head of the World Food Program coming here and we have several matters to discuss with the IMF. Therefore, if this government leaves there should be another government,” he said.
Rajapaksa appointed Wickremesinghe as prime minister in May after Mahinda Rajapaksas, the former prime minister, was forced to resign amid violent protests.
The former prime minister’s house was also set on fire by protesters in May 2022.