Editor's note: Gen. Michael V. Hayden, who was appointed by President George W. Bush as CIA director in 2006 and served until February 2009, is a principal with the Chertoff Group, a security consulting firm, and a distinguished visiting professor at George Mason University. He formerly was director of the National Security Agency and held senior staff positions at the Pentagon.
(CNN) -- Like impatient theater-goers watching a predictable and maddeningly slow-moving plot, everyone involved in today's Libyan drama is awaiting the death, exile or capture of Moammar Gadhafi.
It would be good to remind, though, that when the curtain descends on that now inevitable denouement, we will have completed but the first act of what promises to be a long and complex production.
"Rebel" forces have taken control of Tripoli and several other key cities, but in this case "rebel" is far from a collective noun.
Strains between regions were obvious even in victory; Tripoli was liberated by forces from western Libya and Misrata with little sense of indebtedness to the leadership in Benghazi. The seam between liberals and Islamists was widened by the latter taking public credit for the final push. Tensions between former regime officials, returning expatriates and long- suffering citizens continue to simmer as the murder two weeks ago of former Gadhafi and former rebel commander Abdel Fattah Younis remains unsolved.
The chairman of the National Transitional Council, Mustafa Abdel Jalil, with all the integrity and good intentions he might bring to the challenge, will have to lead and govern beyond his life experience as lawyer, judge and Gadhafi's justice minister.
There are some things in his favor.
The Libyan population of about seven million is relatively small, and with oil reserves readily available the country is relatively rich. Its two immediate neighbors, Tunisia and Egypt, are vested in his success if only to deflect potential destabilizing dangers from their own revolutions.
But Libya was hardly a unitary state before Gadhafi took power, and his four decades of erratic, arbitrary rule destroyed what may have been left of the institutions of civil society.
One assumes that NATO and the United States knew all of this going in when the decision was made to pick and back a winner in what had become a Libyan civil war. The air campaign that followed was a longer and more close-run thing than most policy makers expected and stretched the capacity of the allies in a way that reinforced outgoing Defense Secretary Robert Gates' stinging valedictory message that European disinvestment in defense had threatened the future relevance of the alliance.
The dominant sounds coming out of NATO headquarters in Naples, Mons and Brussels today are likely sighs of relief.
Stretching the U.N. mandate to "protect civilians" as far as humanly (and legally) possible, it still took more than five months to conclude what amounted to a punitive expedition in largely undefended airspace. The final breakthrough occurred as the U.N. mandate and stocks of precision weapons were expiring. And this was the easy part.
The United States, NATO and the international community in general will now have to be both generous and wise: generous in terms of resources (advisers, specialists, targeted assistance) and wise in not further eroding the made-in-Libya character of the revolution.
We have already seen the first evidence of Libyan prickliness in this regard in the NTC's refusal to countenance the re-extradition of Lockerbie bomber Abdel Basset al-Megrahi to any of the powers on which they were forced to rely for their military success.
Besides being wise themselves, Libya's friends will also have to help Libya's new government find its own path of prudence.
In dealing with former regime officials, for example, any course that mirrors the de-Baathification process in Iraq would have deeply unfortunate consequences. In a society where persistent tribal identities have often defined haves and have-nots, an overly aggressive "reckoning" could fracture desperately needed national unity.
And as difficult as it might be, the path of prudence may also require that Libyans forego final retribution for Gadhafi and his kin. If he is not killed, Gadhafi in impotent (and silent) exile or before an international tribunal would relieve the new government of dealing with the massive distraction that a Libyan trial would represent.
The stakes are high, and they go beyond Libya.
The Libyan experience has already demonstrated to the people and leaders of Syria and Yemen that revolutionary movements can persist, that seemingly powerful regimes can be brittle and that short-term repression does not guarantee a dictator's long-term survival. A Libya that descends into chaos, however, would give these very same dictators a powerful argument as to why they must remain.
And a Libya in chaos could provide al Qaeda and like-minded groups another ungoverned area as a safe haven much as Yemen, Somalia and northern Mali are today. It could prove fertile ground; the largest number of foreign fighters identified in Iraq came from Libya. Atiya Abdul Rahman, al Qaeda's No. 2 leader killed last week in Pakistan, hails from Misrata, the very same town whose fighters liberated large sections of Tripoli. And his putative successor, Abu Yahya al-Libi, is a countryman.
Libya, Act II, promises to be interesting indeed.
The opinions expressed in this commentary are solely those of Michael V. Hayden.