The defeat of Libyan dictator Muammar Qaddafi’s regime seems to be just hours or days away. His fall will be a victory for the Libyan people whose sacrifices made it possible.

Qaddafi’s ouster will also be a great day for those who believe in freedom. Many around the world will take credit -- some deservedly, some not. First and foremost are the Libyans who faced Qaddafi’s guns, withstood his artillery fire and weren’t intimidated by his threats of retribution.

Others can claim credit, too. When the rebels asked for help, NATO responded, albeit after some hesitation. Lost in all the criticism of NATO’s air operation is the fact that the mission accomplished its goal of preventing Qaddafi from massacring the citizens of Benghazi and other rebel-held towns, and slowly degraded his military forces. NATO remains unpopular in the Middle East, but it is worth noting that its involvement in Libya, like its air campaigns in Bosnia-Herzegovina and Kosovo, protected Muslim civilians from being abused or massacred.

The British and French deserve special praise. They, not the U.S., pushed the United Nations Security Council and NATO to act. If not for British and French leadership, Qaddafi would almost certainly have been given a free hand to crush the uprising.

Libya’s story isn’t finished. The new leadership is about to find that it is much easier to unseat a brutal dictator than to build a democratic government and tolerant society. The next few weeks may be chaotic and probably bloody as Libyans take advantage of the breakdown in central authority to settle scores. Any appraisal of the new government should consider what would have happened had Qaddafi remained in power.

Qaddafi Loyalists

The Transitional National Council should resist the temptation to seek reprisal against Qaddafi loyalists. Qaddafi, his son Saif al-Islam, and intelligence chief Abdullah al-Senusi have been indicted by the International Criminal Court. If captured alive, they should be sent to The Hague for trial. Other Qaddafi cronies might face justice in Libya. If so, they should be afforded fair trials. The transitional council will also be expected to demonstrate that it will rise above tribe and clan by giving equal rights to Libyans from all parts of the country.

The U.S. and its European allies should offer Libya’s new leaders the help they need to build a system of government and modernize the economy. Jihadist groups are active in the poorly governed territory south of Libya. Helping Libya build a functioning, democratic government is the best way of preventing extremists from establishing a stronghold in the country’s southern desert.

Taking Note

We hope that Bashar al-Assad, another dictator in the Middle East facing a popular rebellion, takes note of events in Libya. Qaddafi assumed that tribal ties and generous amounts of money would keep his army, particularly the vaunted Khamis Brigade commanded by one of his sons, loyal and fighting. Yet, when faced with the inevitability of a rebel victory, the army melted away.

Like Qaddafi, Assad is relying on the loyalty of his security forces to preserve his hold on power. To that end, he has put relatives in command of critical units composed mainly of fellow Alawites. Assad still has time to step down and go into exile. If he doesn’t, he risks sharing Qaddafi’s fate.

Qaddafi’s 42-year dictatorship represents the old Middle East. He was overthrown by his own people, most of whom grew up under his rule and knew nothing else. It is up to the Libyan people to decide if they have exchanged dictatorship for freedom or for a different form of dictatorship. The West should be prepared to help, but Libya’s fate is in their hands.

To contact the Bloomberg View editorial board: view@bloomberg.net.