Forces loyal to Libya's internationally recognised government said on Friday they had entered Tarhouna near Tripoli, depriving the Libyan Arab Armed Forces (LAAF) of their “last major stronghold” in the west of the country, Reuters and AFP reported.
"Our heroic forces have extended their control over the whole of Tarhuna," said Mohamad Gnounou, spokesman for the Government National Accord (GNA).
The GNA was already buoyed by the recapture of the whole of greater Tripoli, according to AFP.
There was no immediate comment from the LAAF on whether its forces remained in the town, a day after they were pushed from their last positions in the capital.
The LAAF have confirmed their "redeployment" away from the Libyan capital following the UN-recognised government's announcement it is back in full control on Thursday.
The GNA said it had retaken the whole of Greater Tripoli, thanks to Turkish support.
The recapture of the international airport in Tripoli -- long out of use -- is the strongest symbolic victory for the Libyan government so far, reported the BBC's Arab affairs editor, Sebastian Usher.
LAAF spokesman Ahmad Al-Mesmari said the redeployment was a "humanitarian gesture intended to spare the Libyan people further bloodshed."
Hundreds have been killed and 200,000 more driven from their homes since the Tripoli battle began in April last year, when commander Khalifa Haftar, a leader of LAAF, vowed to "cleanse" the capital of the "terrorist militias" he said dominated the GNA.
Mesmari said the redeployment was also intended to give a boost to the work of an UN-backed military commission tasked with shoring up a nationwide ceasefire.
"We announce that we are redeploying our forces outside Tripoli on condition that the other side respect the ceasefire," he said in a statement released late Thursday.
"If they do not respect it, we will resume military operations and suspend our participation in the negotiations of the military committee."
The United Nations' Libya mission said Tuesday that after a three-month suspension, the warring parties had agreed to resume ceasefire talks.
A military commission made up of five GNA loyalists and five LAAF delegates held talks in February, but the dialogue was suspended.
A new diplomatic effort is under way to try to restart talks on a lasting ceasefire in the oil-rich nation, according to BBC.
In comments on Thursday, Egyptian Foreign Minister Sameh Shoukry slammed Turkey for sending foreign fighters from Syria to Libya.
In a video address to a meeting of the Global Coalition to Defeat ISIS, Shoukry warned that the success achieved over the foreign fighters in Syria and Iraq by the coalition is threatened by the role the Turkish government is currently playing in terms of recruiting, training and transferring thousands of foreign fighters from Syria to Libya.