Libya's authorities have struggled to impose order as many ex-rebels have banded into militias and carved their own fiefdoms in a country awash with weapons looted from Kadhafi's arsenal.
Thursday's violence erupted after news broke that Nuri Friwan, a militia chief from Misrata, a city that saw some of the most brutal fighting in the 2011 uprising, had died.
Friwan had been wounded on Tuesday when a fight erupted at a checkpoint manned by rebels of Soug al-Jomaa district in eastern Tripoli.
In revenge, Misrata militiamen drove to Soug al-Jomaa in vehicles equipped with anti-aircraft guns, blocking the main road to the area, witnesses said.
Witnesses and security officials said intense fire and explosions rocked several parts of the capital overnight and could be heard well into the early hours of Friday.
"Each group opened fire into the air as a show of force," a security official said.
A health ministry spokesman said two people were killed and 29 wounded, but that most of those hurt had left hospital after receiving first aid.
Several buildings were hit by anti-aircraft fire, including the 15-storey Radisson Hotel, which is used by diplomats and businessmen.
A hotel spokesman said nobody was hurt.
A representative of an international organisation staying at the hotel told AFP "the hotel's security services told us to go down to the basement where we spent most of the night."
"And today it is as if nothing happened," she said.
On Friday morning, the weekly day of rest in Libya, it was business as usual in the capital and shoppers crowded the animal market in the Soug al-Jomaa neighbourhood.
An AFP correspondent who toured the city where fighting had raged only hours earlier said there were no security forces to be seen anywhere.
"What is quite worrying is that the authorities have not issued any official reaction. They are mere spectators and this shows their weakness and their inability to govern," said the Western diplomat, speaking on condition of anonymity.
Later Friday, the government condemned the "deplorable events" of the previous night and promised to "bring their authors to justice and to take all necessary measures to avoid a repetition."
For their part, the embassies of the four Western powers reiterated their support for Libya's "elected political institutions," and also called on people to work in the national interest "to aid in reinforcing democratic institutions with a view to fully realising the aspirations of the revolution."
A number of embassies themselves have come under attack amid the lawlessness, and US Ambassador Chris Stevens and three other Americans were killed in an assault on the US consulate in second city Benghazi two years ago.
In Benghazi on Friday, the army said it was deploying troops to put an end to a wave of attacks there, notably targeting officers in the security forces.
The rebels who overthrew Kadhafi were hailed as heroes for bringing an end to more than four decades of dictatorship.
But many have rejected government demands to turn in their weapons or join the national security forces, posing a constant threat to the stability of post-Kadhafi Libya.