Mr Wickremesinghe’s spokesman Dinouk Colambage said the premier had told party leaders he will resign when all parties have agreed on forming a new government.
His decision came after the biggest protest yet swept Sri Lanka on Saturday, with tens of thousands of people breaking through barricades and entering president Gotabaya Rajapaksa’s residence and nearby office to vent their fury against a leader they hold responsible for the nation’s worst economic crisis.
It was not clear if Mr Rajapaksa was at the residence in Colombo, but footage filmed on mobile phones showed a large number of people inside the well-fortified house and on the grounds outside.
Hundreds of protesters, some carrying national flags, also entered the president’s office in a nearby building.
Video posted on social media showed hundreds of protesters running into the president’s residence, chanting “Gota go home”, calling the president by his nickname. Outside the building, barricades were overturned.
At the president’s office, security personnel tried to stop protesters who passed through the fences and stormed the colonial-era parliament building, which has been converted into his office.
At least 34 people including two police officers were injured in scuffles as protesters tried to enter the residence. Police fired tear gas at protesters.
Two of the injured are in a critical condition while others have sustained minor injuries, hospital officials said.
Thousands of protesters had entered Colombo from the suburbs earlier on Saturday after police lifted an overnight curfew.
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.
The economic crisis has led to a heavy shortage of essentials like fuel, cooking gas and medicines, forcing people to stand in long queues to buy the limited supplies.
Months of protests have nearly dismantled the Rajapaksa political dynasty that has ruled Sri Lanka for most of the past two decades.
One of Mr Rajapaksa’s brothers resigned as prime minister last month, and two other brothers and a nephew quit their cabinet posts earlier, but Mr Rajapaksa has held on to power.
Mr Wickremesinghe took over as prime minister in May and protests temporarily waned in the hope he could find cash for the country’s urgent needs, but people now want him to resign saying he has failed to fulfil his promises.