Violence raged across Sri Lanka late into the night on Monday, with five people dead and some 180 injured as prime minister Mahinda Rajapaksa quit after weeks of protests.

Those killed in the worst unrest since the crisis began included a lawmaker from the ruling party who shot two people. Another ruling party politician gunned down two others.

Earlier in the day, government supporters in the capital Colombo attacked with sticks and clubs opponents angry over Sri Lanka’s worst economic crisis since the island nation’s 1948 independence.

“We were hit, the media were hit, women and children were hit,” one witness said, asking not to be named, as dozens of people were admitted to hospital.

US Ambassador Julie Chung tweeted that Washington condemned “the violence against peaceful protestors” and called for the Sri Lankan government “to conduct a full investigation, including the arrest & prosecution of anyone who incited violence”.

The clashes precipitated the resignation of prime minister Rajapaksa, the elder brother to President Gotabaya Rajapaksa. In stepping down, the premier said he was paving the way for a unity government.

But it was unclear if the opposition would join any administration with Gotabaya Rajapaksa as president, and the resignation failed to assuage public anger.

Retaliatory attacks by government opponents were reported across the island of 22 million people even after police declared an indefinite curfew.

Thousands of protestors tried to storm the official residence of the prime minister in the capital, setting fire to a truck at the entrance as they breached the main gate.

Police responded by firing tear gas and gunshots into the air from the residence where Mahinda Rajapaksa remained holed up.

Witnesses saw several tear gas cannisters hit the US embassy compound across from the Temple Trees residence, a key symbol of state power in the South Asian island.

Officials said the military deployed hundreds of troops to guard the outgoing premier and his aides at the building.