Who, today, does not thrill to the spectacle of freedom in Tripoli? A brave people, civilians in the main, exiles who returned to their devastated country, students with no military skills—all headed to the front in their pickup trucks to reclaim their homeland from a tyrant who had turned it into a laboratory for his mix of megalomania and derangement. These are the people who have made this rebellion.
It was not perfect, that campaign that upended the kleptocracy in Tripoli. NATO did not always perform brilliantly. The Obama administration didn't have its heart in that fight. We second-guessed the rebels in Benghazi and their intentions at every turn. We would not release to them sequestered Libyan funds that could have leveled the killing field and brought the fighting to a close a good deal sooner. A new doctrine was spun to justify American passivity: "Leading from behind," it was called.
But all this can be taken up at another time. Suffice it to see the brigades of freedom make their entry into Tripoli. How can those of us in lands of freedom resist a giddy sense of satisfaction that the tyrant's favorite son, Seif al-Islam, is now in captivity? It makes for poor governance in our world to label your own people "rats" and "traitors." After years of fear and submission, the people had gone out in an assertion of their dignity.
When it truly mattered, the foreign mercenaries, guns and killers for hire could not sustain the despot's power. To no great surprise they were not willing to die for the man in his fortified bunker. Nor would the Libyans come to his rescue. He had once described himself as a leader without a country. He had declared an open war on Libya's very own identity and past. He ruled six million people with a hallucinatory work, his "Green Book," a document, he said, which contained all the answers to the problems of human governance.
Libya was a wealthy country, blessed with abundant oil, but the despot turned it into one of Africa's poorest populations. He robbed them of freedom and of economic initiative. The country was turned into a cruel tyranny, and what wealth existed was the prerogative of the man at the helm and his children. Retail trade was decimated. Meaningful work was denied the Libyans.
Four decades of a nation's life were squandered by this regime, the narcissism of the ruler all the more galling against the background of a sullen and humiliated population. Fear governed and paralyzed the land, the "revolutionary committees" of the despot had the run of the place. Always with Gadhafi, the buffoonery and the personal depravity—the outrageous costumes, the tent he carried with him to distant capitals, the rantings in international forums, the phalanx of female bodyguards in a conservative Muslim society, and the four "voluptuous" Ukrainian nurses who travelled with him everywhere—went hand in hand with official terror against dissidents who dared question his despotism.
Europe was nearby, and the madman knew how to exploit its fears: He was standing sentry, he said, on behalf of Europe, and were he to falter or to be offended, he would turn Europe black, he said, overwhelm it with illegal African immigrants.
There was cunning in Gadhafi. How else can one account for the "reparations" he had exacted from Italy for the interwar Italian occupation of Libya? The greed of others saw him through: He could kill en masse passengers aboard American and French airliners and still find room to play on the international stage. He never ran out of foreign interlocutors keen to bring him into the fold of "normal" nations. A regime of this barbarism and incoherence needed foreign indulgence, and the man in Libya had it aplenty.
"The best day after a bad emperor is the first," the great Roman historian Tacitus observed. Doubtless, Libya after this hurricane will have to contend with enormous challenges. There are no viable institutions to sustain it, so determined was Gadhafi to leave the country barren of any meaningful public life.
There will remain the schism between the provinces of Tripolitania in the west and Cyrenaica in the east. Libyans will insist that these differences have been healed by a common history of torment at the hands of the despot. This could be a sincere sentiment, and may pull the Libyans through. But from the time this country was put together by the Western powers some six decades ago, that schism had a force all its own.
The rebels in Benghazi will be called upon to show clemency and restraint in the aftermath of their victory. A hunt for demons and collaborators will betray the new Libya, for four decades of totalitarian dictatorship are sure to sully practically all with any experience in public life.
Because we "led from behind" and never fully embraced this rebellion, American diplomacy ought to approach the emerging new order with a measure of reticence and modesty. In our attempt to divine the ways of this rebellion, there were fears that radical Islamists, even elements of al Qaeda, could be found in the ranks of the rebels. This was, in part, an alibi for the hesitancy that marked the American approach in this crisis. It had been Gadhafi himself, it shall be recalled, who dragged a reluctant Barack Obama into this conflict when he threatened Benghazi with the prospect of draconian punishment.
But there was sincerity as well in the worry about the rebels, and it came in the form of evidence gathered by U.S. intelligence in Iraq in 2006-07. Libyan jihadists had made their way to Iraq—they were second in numbers to the Saudis, and they predominantly hailed from the eastern part of the country.
There is no way that a blanket assertion can be made that this massive Libyan upheaval is free of Islamists. What we have is the more compelling evidence of the rebellion itself—its composition, the earnestness of the professionals and civil libertarians active in it, their promise that the terrible autocrat will not be replaced by a zealous, unforgiving theocracy.
Revolutions can be stolen and hijacked, this we know, the moderates overwhelmed by determined extremists. But if a bet is to be made on the spectacle now before us, it should be easy to see a better Libya than Gadhafi's monstrous regime rising out of this contest.
Mr. Ajami is a senior fellow at Stanford University's Hoover Institution and co-chairman of Hoover's working group on Islamism and the International Order.