At least six people have been killed and 32 others injured by gunfire in the Lebanese capital, Beirut.
It began during a protest by the Shia Muslim groups Hezbollah and Amal against the judge investigating last year's huge blast at the city's port.
They said Christian snipers from the Lebanese Forces (LF) faction fired at the crowd to drag Lebanon into strife - a claim denied by the LF.
Huge tension surrounds the probe into the port explosion that killed 219.
Hezbollah and its allies claim the judge is biased, but the victims' families support his work.
No-one has yet been held accountable for the August 2020 disaster, in which swathes of the city were devastated.
In response to Thursday's shooting, some of Lebanon's worst violence in years, Prime Minister Najib Mikati announced a day of mourning on Friday.
Meanwhile, President Michel Aoun said: "We will not allow anyone to take the country hostage to their own interests."
What began as a protest outside the Palace of Justice - the main court building - by hundreds of people arguing the investigation had become politicised and demanding the removal of Judge Tarek Bitar escalated remarkably quickly, reports the BBC's Anna Foster in Beirut.
Heavy gunfire erupted in the streets as the crowd passed through a roundabout in the central Tayouneh-Badaro area.
Local residents had to flee their homes and schoolchildren ducked for cover under their desks as men armed with automatic rifles and rocket-propelled grenade launchers - believed to have been members of Shia and Christian militias - exchanged fire in the streets.
The clashes continued for several hours before calm was restored.
At a nearby school, teachers instructed young children to lie face down on the ground with their hands on their heads, a witness told Reuters news agency.
Hospital and military sources said some of those killed were shot in the head. They included a woman who was hit by a stray bullet while inside her home.
Hezbollah and Amal accused a staunch opponent, the Christian Lebanese Forces party, of being behind the attack on the protesters.
The two Shia organisations said demonstrators were "subject to an armed attack by groups from the Lebanese Forces party that deployed in neighbouring streets and on rooftops, and engaged in direct sniping activity and intentional killing".
Lebanese Forces leader Samir Geagea condemned the violence and appealed for calm.
"The main cause of these developments lies in the presence of uncontrolled and widespread weapons that threaten the citizens at any time and in any place," he tweeted.
Mr Mikati called on everyone to "calm down and not be drawn into sedition for any reason whatsoever".
The army said it had deployed troops to search for the assailants, and warned that they would "shoot at any gunman on the roads".
Earlier on Thursday, a court dismissed a legal complaint brought by two former government ministers and Amal MPs - Ali Hassan Khalil and Ghazi Zaiter - whom Judge Bitar has sought to question on suspicion of negligence in connection with the port explosion.
The two men, who deny any wrongdoing, accused the judge of bias.
Families of the victims had condemned the complaint, which caused the probe to be suspended for the second time in three weeks.
They have accused the country's political leadership of trying to shield itself from scrutiny.
"Keep your hands off the judiciary," they warned the cabinet on Wednesday after ministers allied to Hezbollah demanded that Judge Bitar be replaced.
The port blast happened after a fire detonated 2,750 tonnes of ammonium nitrate, a combustible chemical widely used as agricultural fertiliser, that had been stored unsafely in a port warehouse for almost six years.
Senior officials were aware of the material's existence and the danger it posed but failed to secure, remove or destroy it.