Rebel soldiers in the streets of Tripoli are still savoring the ouster of Moammar Gadhafi and his forces. But rebel commanders are facing the difficult task of uniting disparate militias and consolidating their powers.
By some accounts, members of a newly formed security council are spending more time vying for power among themselves than they are in ensuring security.
At a checkpoint in Tripoli, young men in scavenged military garb chant, "God is greatest."
This group is from Tripoli, but the fighters have come from all over the country. Most had not met or fought together before their units converged in the capital.
Officials say they're making progress at welding all these groups together. But the formation of a national army is still far off, and people close to the process say there are divisions among the rebel groups.
The Transitional National Council, the main rebel body, has created the Supreme Security Committee to oversee the process. But so far, it's not clear who is on the panel or what it's doing.
Rebels Begin To Divide Capital
In the meantime, rebel commanders are reportedly maneuvering for control of key locations in Tripoli.
The top commander in the capital is Abdel Hakim Belhaj, whose Tripoli Brigade had a key role in taking the city. Belhaj, 45, has a bitter history with the Gadhafi regime.
He was part of an Islamist group that sought to launch an insurrection against Gadhafi in the early 1990s. When that effort failed, he fled.
A Libyan government warrant for his arrest charged that he spent time in Afghanistan, helping train fighters linked to the Taliban.
Belhaj was eventually captured by the CIA in Thailand and was sent back to Libya, where he says he was imprisoned and tortured.
Belhaj was freed in 2010, and became part of the new rebel movement that began the uprising in February.
Since the rebels took Tripoli last month, he has been consolidating key points in the city, such as the ports and government buildings, including the prime minister's office.
But when asked, he side-stepped the issue of who controls what.
He says the rebels have formed committees and are working on building a national military, as part of building a country of laws and civil institutions.
Belhaj has played down his Islamist roots, although he has said he deserves an apology from the CIA for sending him back to Libya.
Ex-Gadhafi General In Key Role
Perhaps the second most powerful man in Tripoli right now is Maj. Gen. Suleiman Mahmoud al-Obeidi, who defected from Gadhafi's army early in the rebellion.
Obeidi was named interim chief of staff for the rebel forces in late July, so in theory, he is the top military commander. But in Tripoli, his forces reportedly occupy fewer key points than Belhaj's.
The two men have separate headquarters.
"So you had all these different units that were unified in fighting Gadhafi. But beyond that, you had to ask yourself, 'Well wait a minute, when he goes, how unified are they really gonna be?' We don't know. They don't know," says David Gorman, with the Center for Humanitarian Dialogue, which is based in Geneva, Switzerland.
Gorman's group is working on ways to reduce conflict among the rebel factions. He says he's optimistic, in part because the rebels have managed to work through other potentially explosive situations in the past.
One critical divide is between the civilian rebel fighters and the career military men who came over from Gadhafi's armed forces.
Army defectors helped train the civilian rebels, but some civilians feel they bore the brunt of the fighting. In turn, the military men say the rebels were reckless and ill-disciplined.
The sources who described those divisions weren't willing to talk on the record, because they are involved in efforts to unite the various sides.