The country's largest opposition party had said before the clashes that it would not join any government helmed by a member of the Rajapaksa clan.
The resignation of the prime minister automatically means the cabinet stands dissolved.
On Monday the biggest clashes since the start of the crisis erupted in Colombo when supporters of the Rajapaksa family went on the rampage, AFP reporters at the scene said.
Police fired tear gas and water cannon and declared an immediate curfew in Colombo which was later widened to include the entire South Asian island nation of 22 million people.
At least 78 injured people were hospitalised, Colombo National Hospital spokesman Pushpa Soysa told AFP.
Officials said the army riot squad was called in to reinforce police. Soldiers have been deployed throughout the crisis to protect deliveries of fuel and other essentials but until now not to prevent clashes.
Scores of Rajapaksa loyalists attacked unarmed protesters camping outside the president's office at the sea-front Galle Face promenade in downtown Colombo since 9 April, AFP reporters said.
The violence began after several thousand supporters of Mahinda Rajapaksa, brought in buses from rural areas, poured out of his nearby official residence.
Rajapaksa had addressed some 3,000 supporters at his house and pledged he would "protect the interests of the nation."
The supporters then initially pulled down tents of protesters in front of the prime minister's Temple Trees residence and torched anti-government banners and placards.
They then marched to the nearby promenade and began destroying other tents set up by the "Gota go home" campaign that demands the president step down.
"We were hit, the media were hit, women and children were hit," one witness told AFP, asking not to be named.
"Strongly condemn the violent acts taking place by those inciting & participating, irrespective of political allegiances. Violence won't solve the current problems," president Rajapaksa tweeted.
Opposition MP Sajith Premadasa tried to move into the area after the clashes, but he came under attack from a mob and his security staff bundled him into a car and drove off.
"The President should accept the responsibility for this violence instigated by the Prime Minister!," opposition MP Eran Wickramaratne tweeted. "You cannot chase us from standing with our people."
The US ambassador to Sri Lanka condemned "the violence against peaceful protestors today, and call on the government to conduct a full investigation, including the arrest & prosecution of anyone who incited violence".
"Our sympathies are with those injured today and we urge calm and restraint across the island," Julie Chung tweeted.
The violence was the worst since police shot dead one protestor and wounded 24 others blockading a railway line and a highway between Colombo with the central city of Kandy on 19 April.
On Friday, the government imposed a state of emergency granting the military sweeping powers to arrest and detain people after trade unions brought the country to a virtual standstill.
The defence ministry said in a statement Sunday that anti-government demonstrators were behaving in a "provocative and threatening manner" and disrupting essential services.
President Rajapaksa has not been seen in public since tens of thousands attempted to storm his private residence in Colombo on 31 March.
Sri Lanka's crisis began after the coronavirus pandemic hammered vital income from tourism and remittances.
This left it starved of foreign currency needed to pay off its debt and forcing the government to ban the imports of many goods.
This in turn has led to severe shortages, runaway inflation and lengthy power blackouts.
In April, the country announced it was defaulting on its $51 billion foreign debt.