The pickup trucks, anti-aircraft guns and mismatched uniforms have left Tripoli - for now.
Fed up after a two-week siege of government buildings including the foreign and justice ministries, people rallied on Friday against the presence of armed men on the streets of the Libyan capital. "No to the mooq-mooq," they shouted, using the slang word for the militia groups.
The fighters slunk off, but they had already got their way.
The militias, some of whom work for the government, were demanding the removal of officials who high posts under Muammar Qaddafi before the rebel uprising, backed by international forces, that ousted and killed him. As they bristled with weapons, which they did not fire, the interim parliament passed the Political Isolation Law, that bans Qaddafi-era officials and those who opposed the revolution from public office.
Some legislators insist that they would have passed the law even without pressure from the militias. But it is clear that the Libyan state does not hold the balance of power over these fractured, armed groups.
In some ways, this is not suprising. It would have been naive to expect Libya to arrange itself neatly into a party political system within a liberal democracy after 42 years under Qaddafi's dictatorship. It has no tradition of politics and there is every sign that competing interest groups - like the militias - will continue to fight with the government for power and influence in the coming months.
Relationships in Libya are underpinned by complex systems of reciprocity and rivalries on a family, tribal and regional basis. The fault lines were exploited under Qaddafi, and as a result the vast country can sometimes seem less like a unified nation than a loose string of city-states and desert oases.
When the uprising came in 2011, the initial organisation was often run on a local level - by a council or tribal leader. The Transitional National Council, the visible, often English-speaking face of the uprising that solicited support from the outside world, did not build strong enough relationships with these grass-roots groups.
As a result, some local leaders and fighters do not feel strongly invested in the democratic system emerging in Tripoli. In Benghazi, the second city, the resentment from decades of neglect while Tripoli grew lingers. An eastern separatist movement occasionally rears its head. This interim government, and the one that is scheduled to follow when a constitution is finally written, will struggle to assert authority over these factions - especially the armed ones.
It is in this context that the new law is most worrying. Its language is vague and ripe for exploitation by rival groups to hobble factions or families whom they wish to exclude from power.
In Iraq, similar legislation designed to prevent Saddam Hussein loyalists from coming to power was hijacked by men with a sectarian agenda and used to neutralise political enemies.
While the vast majority of Libya is Sunni, other divides exist. Its history of bloodshed and bitterness that fosters a spirit of revenge. The new law, and the armed men on the streets, are harbingers of what will be a messy struggle for power in Libya.