Lebanese security forces have fired rubber bullets, tear gas and used water cannons to disperse anti-government protesters from the centre of Beirut.

The violence, which started on Saturday and lasted in the early hours of Sunday, was some of the worst since the demonstrations began two months ago.

More than 40 protesters were injured, including some beaten repeatedly with batons by security forces. The clashes brought the city centre to a standstill for over eight hours as security forces fired a stream of tear gas canisters at the hundreds of protesters, who set fires in trash cans on the main streets, in part to mitigate the effects of tear gas.

The protesters chanted slogans against security forces and government officials, and pelted police with stones in scenes not seen in the capital since the demonstrations began on 17 October.

At one point, the scuffles reached the headquarters of one of the main Lebanese political parties, the Kataeb, where many protesters were taking cover. The head of the party, Samy Gemayel, appeared on local television as he tried to separate the protesters from advancing security forces.

Riot police arrest an anti-government protester in Beirut. Photograph: Hussein Malla/AP

Lebanon is facing one of its worst economic crises in decades, and the protesters accuse the ruling political class in place for three decades of mismanagement and corruption.

The violence comes just two days before the president is due to hold talks with different parliamentary blocs to name a new prime minister.

The government headed by former prime minister Saad Hariri resigned on 29 October two weeks after the nationwide protests began. Political groups have been unable to agree on a new candidate while protesters have been calling for a government unaffiliated with established political parties.

Local television station LBC showed dozens chanting against Hariri, who is emerging as the favourite candidate despite all the political bickering. The protesters also shouted “The people want to bring down the regime” and accused government forces of excessive force.

Protesters in Beirut. Photograph: Nabil Mounzer/EPA

The Red Cross and the Lebanese civil defence force said at least 46 people were injured and transported to hospitals.

More protests are expected later on Sunday.

The trouble started on Saturday when dozens of men, some wearing masks, threw stones and firecrackers at security forces on one edge of a camp in central Beirut where protesters have been based. They were supporters of the Shia Hezbollah and Amal groups, angered by some of the criticism of their leaders by anti-government protesters.

It was the second time this week the groups tried to attack the protest camp. The country’s national news agency said one member of security forces was injured. Local leaders, including a mosque preacher, appealed to calm.

Hours later, hundreds of anti-government protesters, including women, gathered outside parliament, hundreds of metres away from the protest camp. Chaos ensued with reports of an attack on the anti-government rally, leading to a confrontation with security forces who tried to disperse the protesters. For the first time since the protests erupted in Beirut, anti-riot police fired rubber bullets as they chased the demonstrators away from the area.

It was not clear what caused the crackdown. The parliament’s speaker is the head of the Shia Amal group.

The clashes spread to streets surrounding the protest camp, engulfing the area in thick white smoke and the odour of tear gas. Security forces chased protesters around central Beirut, some firing rubber bullets and several volleys of tear gas from armoured vehicles. Dozens of protesters had travelled to Beirut from the northern city of Tripoli to take part in the rally outside the parliament building.

The news agency reported that some shop windows in the commercial part of central Beirut were smashed by vandals. One officer was injured in the eye when a protester hit him with a stone, an Associated Press reporter said. Early on Sunday, nearly a dozen riot police were seen standing over two protesters and beating them with batons.

Tension has been building up in the protest camp. Some accused activists who organize discussions in the camp under the name “the Hub” of hosting critics of Hezbollah and calling for normalization of ties with Israel. The tent was attacked earlier in the week with firecrackers, burning it down. On Saturday, a rally to support the Hub was canceled shortly before the attempted attack on the protest camp.