Hundreds of ex-revolutionaries turned up at the Congress building
Gunmen have ended their siege of Libya's parliament, having been given the chance to meet the prime minister to air their grievances.
Dozens of militiamen occupied the complex on Wednesday to protest against the formation of the new government.
They called for the removal of some of the ministers who have links to the late Muammar Gaddafi's regime.
All the gunmen left the Congress building over the course of Friday, the BBC's Rana Jawad in Tripoli says.
Earlier there were reports that a few had remained in the building while most of the group had left after a meeting with Prime Minister Ali Zidan.
During that meeting, according to a well-placed Congress source, they had "voiced their objections to certain ministers in his cabinet and he is taking them into consideration".
It is understood that Mr.
Zidan made no concessions or promises, our correspondent says.
Gunmen broke through security and occupied the Congress building late on Wednesday, and at least a dozen trucks mounted with anti-aircraft guns lined the main road to the parliament on Thursday.
Our correspondent said some of the gunmen were dressed in scruffy army fatigues while others wore civilian clothes; some had come from the western city of Misrata and some were from Tripoli.
One militiaman dressed in civilian clothes told her: "Some of [the ministers] have had long ties with Gaddafi, we don't want them".
The stand-off began hours after a new cabinet was approved on Wednesday.
Despite largely peaceful elections in July, Libya's transition continues to be affected by instability.
Reining in the different militia and trying to integrate them into a single national army will be one of the biggest challenges for any new government, analysts say.
The new government has representatives from the two most prominent blocs in Congress - the Alliance of National Forces led by liberal former Prime Minister Mahmoud Jibril, and the Muslim Brotherhood's Justice and Construction Party.
In choosing his cabinet, Mr.
Zidan said he had tried to strike a balance between Libya's different regions.
However, the militiamen say several of the ministers have deep-rooted links with Col Gaddafi's era.