TRIPOLI // At a huge weapons depot in the Libyan capital, flatbed trucks line up to be piled high with landmines, rockets and shells before being driven off into the western mountains.
A month after rebels captured Tripoli and forced Muammar Qaddafi to flee, militia groups are sweeping up any weapons they can find, often from huge ammunition dumps left unguarded as his forces retreated.
Some of the militias barely recognise the authority of the new civilian government, and rivalries are surfacing — developments that are worrying officials, civilians and human rights groups.
"Until we have a national army, this will pose a real security threat," said Noman Benotman, a former anti-Qaddafi militant who is an analyst with the Quilliam think tank in London.
The US government says the potential for Libya's vast arsenal to fall into the wrong hands is a serious concern. American officials worry that some of the thousands of unaccounted-for surface-to-air missiles — especially sophisticated shoulder-launched "man-portable air-defence systems," known as manpads, which can bring down civilian airliners — could end up with Al Qaeda.
But a massive haul of explosives, much larger than the stockpiles left by Saddam Hussein that helped fuel the insurgency in Iraq, also poses a risk, especially if Col Qaddafi escapes uses his vast wealth to sponsor a guerrilla movement.
"While the international community until today is focused on manpads, for Libya the greater danger is from explosives and weapons that can be turned against them, as they were in Iraq and Afghanistan," said Peter Bouckaert, emergencies director at Human Rights Watch. "The mix of these unsecured warehouses, with a leader still on the run who has access to vast funds and a proportion of the population still quite loyal to him, is a lethal one."
Mr Bouckaert said that some people looted warehouses in the days after Tripoli fell and that some of the stolen weapons have found their way to the international market. He warned that this could spread insecurity across Africa's northern region.
The scooping up of many of the remaining weapons and explosives by militias might seem the lesser evil. Nevertheless, it is worrying those who hope that the new Libya will emerge as a country where power comes from the ballot box rather than the gun.
Many of the weapons are heading to the Nafusa Mountains, home to Libya's ethnic Berber minority, according to officials, commanders and well-connected businessmen. Others are going to Misurata, the city that played a major role in resisting Col Qaddafi's army during the revolution.
"These groups do not recognise any authority or any control," a commander said. "These are areas which suffered a lot during the last few months of the regime, and now they think that whatever they do is justified."
Some of the most intense rivalries have emerged between liberals and Islamists, and between brigades based in Tripoli and those from the western mountains, particularly the town of Zintan.
Mountain brigades have refused to leave Tripoli and are resisting moves to bring them under civilian control.
"We want to go under the umbrella of the national army, but it is too early to execute this order," said deputy commander Ali Cuba from Zintan, whose forces are based at Tripoli's main airport. "We are still searching for weapons in this area, around 12,000 pieces, and we want to do this before joining the national army."
Political observers say the fighters from the Nafusa Mountains may be amassing weapons because they fear Tripoli's domination after suffering under Col Qaddafi's rule.
In Misurata, commanders say they are protecting the freedoms they fought for during the uprising against Col Qaddafi.
"We will never give up our weapons until the country is being run by those who deserve to run it," Misurata commander Salem Jhey told the country's interim leader, Mustafa Abdel Jalil, at a public meeting in the city last week.
Mohamed Benrasali, a senior official in Misurata's city council and a member of the team trying to stabilise Libya, said his city would not surrender its arms "until we have an elected parliament, and an elected government, and an elected president." That could take up to two years.
But there is a sense in Tripoli that brigades and regions are sizing up one another based on how many fighters and weapons they possess.