Libya's rebels began as a disparate group of former government insiders, Western-leaning intellectuals, businessmen and even a smattering of ex-Islamist militants. But they were united by one goal: to unseat Moammar Gadhafi.
They won international recognition by forging a leadership council that espoused democracy. With Gadhafi's regime on its last legs, the question now is whether the opposition can take over the plundered country and lead it effectively.
The task of putting Libya back together after six months of civil war and 42 years of Gadhafi rule is all the more difficult because the nation has no experience at the ballot box or with democratic institutions. Gadhafi ran the country according to his whims and idiosyncratic political philosophy. And he brooked no dissent.
"The rebels want a Libya reconciled with itself, that is democratic, whatever that may mean," said George Joffe, a Libya expert at Cambridge University. "But the way in which they're going to do that isn't clear. ... There are absolutely no basic structures they can use."
Without any practical experience to fall back on, the council has done an imperfect job of managing the territory under rebel control since the uprising began Feb. 15, when youth activists started protesting in Benghazi. As the demonstrations spread and the revolt gained steam, more experienced hands rushed to join the movement and fill the leadership void.
Eventually, the rebellion formed the National Transitional Council. Members are representatives from each rebel-held city, and are selected by similar local councils.
Heading the NTC is Mustafa Abdul-Jalil, a pious former justice minister who joined the rebels in the uprising's first high-level defection. Despite past links with the Gadhafi regime, he enjoys the respect of broad swaths of the rebel public for his criticism while minister of the tight control of security forces. But he is not considered a strong leader or a dominating personality.
Abdul-Jalil is one of several former regime members who make up a powerful bloc on the council. The group includes the head of the rebels' acting Cabinet, Mahmoud Jibril, as well as the rebels' chief diplomat, Ali al-Essawi.
Jibril, educated at the University of Pittsburgh, helped draw up ambitious visions for the future. One of them, titled "Libya 2025: A Look Ahead," called for a restricted role for the state, free expression and the opening of the free market.
Past efforts inside Gadhafi's government have earned former regime members respect in rebel-ruled eastern Libya. They say they strive to create a democratic state, but they are not natural politicians, and the long periods many spent abroad make them distant figures.
The movement also has sought help from Libyans who have returned from exile eager to play a role in the nation's rebirth. Chief among them is Ali Tarhouni, a straight-talking economics professor who left his teaching job at the University of Washington to become finance minister in the rebel Cabinet.
The rebellion has also found space for Islamists, including former members of the Libyan Islamic Fighting Group, a radical Islamist organization that staunchly opposed Gadhafi. Some high-ranking officials in the rebel security apparatus and military have backgrounds in the group.
Some divisions have already emerged in the rebel camp, which could expand if Gadhafi falls.
Joffe said the national council's relationship with Libya's Berber minority in the western Nafusa Mountains is unclear. The Berbers have spearheaded the offensive on Tripoli, as well as the uprising in the western port city of Misrata that played a central role in the war.
"We don't know whether they'll be prepared to accept leadership of the council" down the road, he said. "There are tensions between the Islamists on the one hand and the exiles on the other, and there are even divisions among the exiles themselves. There is no obvious leader yet, and that alone is a problem."
The NTC was on the brink of collapse as recently as late July, with the killing of military chief Abdel-Fattah Younis.
Younis was a highly divisive figure who served as Gadhafi's interior minister until he defected to the rebellion early in the uprising, bringing his forces into the opposition ranks.
His move raised hopes among rebels and Western allies that the uprising could succeed. But some rebels remained deeply suspicious that he retained some loyalties to the dictator.
His body was found dumped outside Benghazi, along with two of his aides. The rebel leadership has insisted the assassination was the work of the Gadhafi regime, but several witnesses say Younis was killed by fellow rebels.
The slaying has fueled concerns about unity within the rebel movement, as well as the NTC's ability to impose discipline on the units nominally under its control. It sacked the Cabinet in the wake of the killing, and has failed to name a new one.
Regardless of its failings, the NTC is the only political organization in the rebel camp that has the potential to step in after Gadhafi, and the West has pledged to unfreeze billions of dollars in frozen Libyan assets to help the council put Libya on a new path.
For now, Gadhafi's regime remains, albeit weakened, and fighting continued Monday in Tripoli and on other fronts.
The rebels on the battlefield remain focused on finishing the job, but also say they are keeping their eyes on the future.
It will take "a long time for Libyans to get used to the new system and the new democracy," said Akram Ammar, a rebel fighting in the Tripoli offensive. "But in the end, it will be better."