Four days of fighting between militias from Libya's coastal city of Zawiyah and members of the Wershifanna tribe have ended after a truce was agreed, according to fighters on both sides.
Fighting had erupted on Thursday after a row over a military base, a key component of defences under Muammar Gaddafi, along the main highway from Tripoli to Tunisia.
Libyan officials and diplomats say they are concerned at the way local disputes have flared in the heavily armed vacuum left by Gaddafi, and say some groups among those towns which rebelled early against the old order appear to be bandying accusations of pro-Gaddafi sympathies among neighbouring groups in order to further their interests in long-standing local feuds.
The fighting has stopped and brigades from Tripoli have come to maintain the peace, a fighter from Zawiyah said on Monday.
Groups of men were celebrating in the streets of Wershifanna, named after the tribe and a few miles south of the military base, on Monday and many were carrying the flag of the ruling National Transitional Council (NTC).
On Saturday, Mustafa Abdul Jalil, chairman of the NTC, blamed irresponsible former rebels for violence which has fanned fears that thousands of fighters who helped topple Gaddafi may turn on each other.
Abdul Jalil, who NTC members said personally took part in lengthy negotiations since Friday, has been trying to end the clashes between men from Zawiyah and the neighbouring tribe.
NTC spokesman Mahmoud Shammam said Abdul Jalil and other senior Libyan leaders had met representatives of both sides on Sunday in Tripoli to secure an agreement to end the fighting.
Fighters attacked each other with rockets, mortars and machineguns over the weekend, but Reuters journalists in the village of Wershifanna on Monday said there were no signs of continued fighting.
Although Gaddafi is dead, many of the rebel militias that fought to topple him say they will not hand in their weapons until a national army is formed.
Members of the Wershifanna tribe have angrily denied accusations that they harbour loyalties to Gaddafi - several hundred demonstrated in Tripoli on Monday, angry at a local television station which had aired comments to that effect.
(Additional reporting by Alastair Macdonald; Writing by Oliver Holmes)