The United Nations urged restraint on Friday after Libya's Tripoli-based government put its forces on high alert for an assault by fighters loyal to an eastern-based strongman in the remote southern desert.
Energy-rich Libya has been wracked by unrest since the 2011 overthrow of dictator Muammar Gaddafi in a NATO-backed uprising.
It is split between the UN-recognised government in the capital Tripoli in the west and a rival administration backed by military strongman Khalifa Haftar that rules from Benghazi and Tobruk in the east.
A 2020 ceasefire agreed after government forces repelled an assault by Haftar's forces on the capital has largely held until now.
The UN Support Mission in Libya called on "all parties to exercise maximum restraint and avoid any provocative military actions that could be perceived as offensive and might jeopardise Libya's fragile stability".
Western governments voiced concern about "ongoing military movements in Libya's southwest region".
"In the context of continued stalemate in the political process, such movements risk escalation and violent confrontation," a joint statement from the embassies of Britain, France, Germany, Italy and the United States warned.
On Friday, emergency services in Tajoura, an eastern suburb of Tripoli, said nine people were killed in battles between armed groups, which witnesses said lasted for several hours.
It was not immediately clear who was involved in the fighting, and there was no immediate comment from either of Libya's administrations.
A security official told AFP that "the clashes stopped and both sides have withdrawn".
The general staff of the Tripoli-based government said on Thursday it had put its forces on "high alert", ordering them to be "ready to repel any possible attack".
Libyan media said that Haftar's goal was to take the small but strategic government-held oasis town of Ghadames on Libya's western border, along with its airport, an operation that an analyst warned would torpedo the 2020 ceasefire.
Emad Badi, a Libya specialist at the Atlantic Council, said government-held areas of western Libya had been "thrown into a frenzy" by the mobilisation of Haftar's Libyan Arab Armed Forces, "perceived by some to be the prelude to an eventual offensive on Tripoli".
"More importantly, the LAAF seizing Ghadames would officially mark the collapse of the 2020 ceasefire," he added.
The LAAF, led by Saddam Haftar, the son of Khalifa Haftar, announced on Tuesday that it was launching an operation to "secure the country's southern borders and strengthen stability in these strategic areas".
The Tripoli-based High State Council (HSC), which functions as an upper house of parliament, said on Thursday that it was "following with great concern the military mobilisations of Haftar's forces in the southwest".
It said they were "clearly aimed at strengthening his influence and extending his control" over these "strategic areas" on Libya's western border with Tunisia and Algeria.
"These movements are likely to lead us back to armed clashes and are a direct threat to the ceasefire," the HSC said in a statement.
In a video posted Friday on their Facebook page, pro-Haftar forces did not mention Ghadames specifically, saying only that they intended "to secure" several remote oasis towns already under the control of the eastern-based administration.