Rajapaksa submitted his resignation by email late on Thursday and it would become official on Friday, once the document had been legally verified, the speaker's spokesperson said.
Rajapaksa fled to the Maldives on Wednesday and then headed on to Singapore on Thursday on a Saudi Arabian airline flight, according to a person familiar with the situation.
Rajapaksa's decision on Wednesday to make his ally Prime Minister Ranil Wickremesinghe the acting president triggered more protests, with demonstrators storming parliament and the premier's office demanding that he quit too.
Protests against the economic crisis have simmered for months and came to a head last weekend when hundreds of thousands of people took over government buildings in Colombo, blaming the Rajapaksa family and allies for runaway inflation, shortages of basic goods, and corruption.
Inside the president's residence early on Thursday, ordinary Sri Lankans wandered the halls, taking in the building's extensive art collection, luxury cars and swimming pool.
Protest organisers handed back the president and prime minister's residences to the government on Thursday evening.
News that Rajapaksa submitted a letter of resignation triggered jubilation in the commercial capital Colombo where protesters massed outside the presidential secretariat, defying a city-wide curfew.
Crowds set off firecrackers, shouted slogans and danced ecstatically at the Gota Go Gama protest site, named mockingly after Rajapaksa's first name.
"The whole country celebrates today," Damitha Abeyrathne, an activist, said. "It's a big victory."
"We never thought we will get this country free from them," she added, referring to the Rajapaksa family who dominated the South Asian country's politics for two decades.