A gun battle erupted today between hundreds of revolutionary forces and Muammar Gaddafi supporters in the capital for the first time in more than two months.
The clash came after a group tried to raise the green flag that symbolises the ousted leader's regime.
The fighting began when a group of loyalists carrying the green flag appeared on the streets of Tripoli's Abu Salim neighbourhood, which houses the notorious prison of the same name.
Shouting "God is Great" anti-Gaddafi fighters converged on the area, which has long been a loyalist stronghold, in pickups mounted with weapons, setting up checkpoints as heavy gunfire echoed through the streets.
The violence in the capital, which has been relatively calm since then-rebels seized control in late August, underscored the difficulty Libya's new rulers face in restoring order as Gaddafi remains on the run.
He has issued several audio recordings from hiding trying to rally supporters against the North African nation's transitional leadership.
Witnesses said the shooting began after a group of dozens of men and women tried to raise the green flag at the end of a street in the Hay Nasr district.
"I looked out of my window and I saw men and women in a group of 50 to 80 people, carrying the green flag," said Abadi Omar, a resident in one of the buildings in the area. "They put one of these flags at the end of our street. This is when the rebels came out and these people disappeared."
Revolutionary forces started searching every building in the area and found weapons on some of the rooftops, many hidden under water tanks, Omar said. Then snipers opened fire and the gunbattle began as anti-Gaddafi fighters gave chase around the closely packed buildings.
Assem al-Bashir, a fighter with Tripoli's Eagle Brigade, also said revolutionary forces suspected there were snipers in the surrounding high rises after spotting a man trying to raise the green flag.
Another fighter, Ahmad al-Warsly, from the Zintan brigade, said several Gaddafi supporters apparently planned a protest but drew fire because they were armed. They then fled and were pursued by revolutionary forces, prompting fierce street battles.
Al-Warsly said one man carrying a gun was captured and identified as a suspect wanted for the killings of protesters in the nearby city of Zawiya.
"It seems like it was organised," he said. "They were planning to have a big demonstration, then the fight started."
Explosions also were reported elsewhere in the capital, but details could not immediately be confirmed.
While Tripoli has remained mostly calm in recent weeks, revolutionary forces are fighting remnants of the regime in Gaddafi's hometown of Sirte and the desert enclave of Bani Walid.
In Geneva, a senior UN human rights official expressed concern about a risk of serious abuses against suspected loyalists occurring when Gaddafi's last strongholds fall to revolutionary forces.
The head of the UN human right's office's rule of law section, Mona Rishmawi, said Libya's transitional government is trying to ensure the rights of captured Gaddafi fighters are protected but "the system that is currently in place is not adequate".
Fighters in Sirte pounded loyalists holed up in two neighbourhoods with rocket and machine-gun fire today, but also suffered heavy casualties themselves, with wounded men streaming into frontline medical units, then being evacuated to field hospitals on the city's outskirts.
Libya's new rulers have insisted Sirte's fall is imminent, and they expect to declare liberation this week. That could allow them to name a new interim government and set a timeline for holding elections within eight months.
But Gaddafi's forces have proven resilient, fighting back fiercely despite heavy shelling and Nato airstrikes.
Former rebels control much of the battered coastal city after launching a major push a week ago, but they were still under intense sniper fire.
Nato was conducting "intensive overwatch missions" around both areas, according to the British Ministry of Defence.
British warplanes struck three armed trucks belonging to former regime forces hidden beneath trees east of Bani Walid on Thursday, the ministry said.
"The vehicles were successfully engaged by our aircraft, using Paveway guided bombs, and destroyed," Maj Gen Nick Pope said in a statement.
Nato has called the continued resistance by Gaddafi forces in Sirte "surprising", as they appear to be losing the battle since revolutionary forces have the area surrounded.
Tanks and weapons-mounted vehicles from the revolutionary forces have kept up a steady barrage of fire into the small enclave known as District 2, where commanders believe several hundred remaining loyalists, possibly including high-ranking figures from the former regime, are hiding.
Thousands of civilians have fled the city to escape the violence.