Editor's note: Isobel Coleman is the author of "Paradise Beneath Her Feet" and a senior fellow for U.S. foreign policy at the Council on Foreign Relations in New York.
(CNN) -- A year ago, Libyans celebrated the death of dictator Moammar Gadhafi. I wrote then that despite enormous challenges, the country's prospects were actually pretty good. Its small, relatively well-educated population and abundant oil wealth certainly gave it a leg up on neighboring Egypt, which has to make its transition under dire economic circumstances.
Libya's path was never going to be easy, but its trajectory since Gadhafi's death has defied the worst predictions of chaos and civil war.
The Transitional National Council, headed by Mahmoud Jibril, oversaw the first phase of transition. It managed to bring all of Libya's factions to the bargaining table, crafted an electoral law and held successful elections on July 7. Despite security concerns, some 3,700 candidates contested 200 seats with a minimal violence.
Turnout was high among the 1.8 million Libyans who registered to vote in the country's first election since 1965. Bucking the Islamist tide that swept Tunisia and Egypt, Libya's secularists fared well, with the relatively progressive National Forces Alliance winning 39 out of the 80 seats.
There has also been a flowering of civil society in a country that for decades had almost none. Dozens of new organizations focusing on issues such as democracy building, the environment and women's rights have formed in the past year. Some groups played an important role in advocating for a female quota in the electoral law. As a result of that preference -- which required political parties to alternate male and female candidates on their ballots -- women won 33 of the 200 seats.
And thousands of Libyans shared their opinions of the draft law through the council's website and phone line and through social media. Libyans went from being barred from any kind of organized activity outside the reach of Gadhafi's network to creating a rich civic dialogue in a matter of months.
But Libya faces profound challenges, most notably the threat from armed militias that still control parts of the country. Some of those militias adhere to radical, jihadi ideologies. The terrorist attack on the U.S. consulate in Benghazi in which four Americans died, including Ambassador Chris Stevens, is a stark reminder of the danger posed by heavily armed militias and extremists. The government's inability to bring these militias under state control has contributed to an environment of lawlessness.
Much of the violence is fueled by bitter tribal rivalries. Over the past few weeks, competing militias have fought to take control of the town of Bani Walid from Gadhafi loyalists. In some places, the militias are given free rein by a government that cannot provide security. The prevalence of weapons -- many of them looted from Gadhafi's arsenals -- makes things worse.
Still, especially after the Benghazi attack, thousands of Libyans have protested the rise of the militias, demanding that the government disarm them. Undoubtedly, this is an important inflection point in Libya's transition -- a moment when the government must rein in the militias or see them become more deeply entrenched, more emboldened and harder to dislodge.
Libya's next challenge is the writing of a new constitution, and it has set itself an ambitious, perhaps impossible, timeline of a draft within 60 days of the constitutional committee's first meeting. The country needs time to debate the big issues, and the more actively involved a broad cross-section of civil society is, the better the outcome. As is true in Egypt and Tunisia, religion will be a flashpoint in the constitution. Already, various groups are pressing to make Islam a central source of law, while others are trying to restrict the role of religion. How Islam is reconciled with human rights in general, and women's rights in particular, will be a litmus test for which path forward Libya chooses.
The division of power between the central government and the regions will also be critical to resolve, especially since significant oil resources are at stake. Libyans rightly fear a scenario of civil war fought along regional lines, reminiscent of the tragedy in Iraq.
Clearly, Libya must overcome many political pitfalls and security challenges before it can successfully emerge from its transition. But it has already made significant progress with a legitimate first election, a flowering of civil society and a briskly recovering economy. The United States should continue to support the Libyans with technical assistance, capacity building, military intelligence and critical training of security forces.
The opinions expressed in this commentary are solely those of Isobel Coleman.