Muammar Gaddafi loyalists have seized control of a Libyan mountain city in the most serious challenge to the central government since the strongman's fall.
It underlines the increasing weakness of Libya's Western-backed rulers as they try to unify the country under their authority.
The taking of Bani Walid, one of the last Gaddafi strongholds captured by the new leadership late last year, was the first such organised operation by armed remnants of Gaddafi's regime.
A simultaneous outbreak of shootings in the capital and Libya's second largest city Benghazi raised authorities' concerned that other networks of loyalists were active elsewhere.
The security woes add to the difficulties of the ruling National Transitional Council, which is struggling to establish its authority and show Libyans progress in stability and good government. Bani Walid's fall comes after violent protests in Benghazi, where Libyans angry over lack of reform stormed the NTC headquarters and trashed offices.
In Bani Walid, hundreds of well-equipped and highly trained remnants of Gaddafi's forces battled for eight hours on Monday with the local pro-NTC revolutionary brigade, known as the May 28 Brigade, said Mubarak al-Fatmani, the head of Bani Walid local council.
The brigade was driven out and Gaddafi loyalists then raised their old green flag over buildings in the western city.
Four revolutionary fighters were killed and 25 others were wounded in the fighting, al-Fatmani said.
There were no immediate signs that the uprising was part of some direct attempt to restore the family of Gaddafi, who was swept out of power in August and then killed in the nearby city of Sirte in October.
His sons, daughter and wife have been killed, arrested or have fled to neighbouring countries.
Instead, the fighting seemed to reflect a rejection of NTC control by a city that never deeply accepted its rule, highlighting the still unresolved tensions between those who benefited under Gaddafi's regime and those now in power.
Those tensions are tightly wound up with tribal and regional rivalries around the country.
The May 28 Brigade had kept only a superficial control over the city, the head of Bani Walid's military council, Abdullah al-Khazmi, acknowledged.
"The only link between Bani Walid and the revolution was May 28, now it is gone and 99 per cent of Bani Walid people are Gaddafi loyalists," he said.
He spoke to The Associated Press at a position on the eastern outskirts of Bani Walid, where hundreds of pro-NTC reinforcements from Benghazi were deployed with convoys of cars mounted with machine guns, though there was no immediate move to retake the city.