The death of Libya’s long-ruling dictator at the hands of rebels is certainly cause for celebration in Libya, presuming of course that his replacement will show greater respect for his people’s basic rights and economic well-being. Libyan reactions notwithstanding, it is perfectly legitimate for policymakers in Washington to ask whether the end of the 42-year-old Qaddafi regime, which effectively collapsed months ago, is in the United States’ interests. The knee-jerk reaction that any sort of democracy anywhere in the Middle East, even if short-lived, is in U.S. interests, must be tempered with a less emotional and more analytical approach to looking at events in the context of how they impact, or are likely to impact, medium and longer-term American objectives in the region.

There is no doubt that Qaddafi was, for many years, a significant supporter of terrorism, including terrorism directed at Americans. Libyan involvement in the downing of Pan Am Flight 103 over Lockerbie, Scotland (1988), the attack on U.S. soldiers at a West Berlin discotheque (1986), the murder of a British police constable outside the Libyan embassy (1984), and active support for a range of international terrorist organizations, including the Abu Nidal group, the Japanese Red Army, the IRA, the PLO, Hamas and Palestinian Islamic Jihad. This clearly made the Qaddafi regime a significant threat to the United States and its allies. The Colonel also developed a large stockpile of chemical weapons and had active biological and nuclear weapons development programs – reportedly with over 4,000 centrifuges producing enriched uranium.

In 2003, Qaddafi made a dramatic U-turn, agreeing to compensate the families of the Lockerbie victims and the dismantling of Libya’s chemical, biological and nuclear weapons programs. The centrifuges and other nuclear components were turned over to the United States, the UK and representatives of the International Atomic Energy Agency – though, by 2009, the Libyans were balking at turning over all of their remaining stocks of enriched uranium to the U.S., arguing that they had not been adequately compensated by the West for their decision to dismantle their nuclear program. Nevertheless, the Libyan regime had gone from being an active adversary of the United States and its allies to at least ceasing to be a threat. Moreover, Qaddafi had been an adversary of al-Qaeda and Osama Bin Laden well before the 9-11 attacks as the Libyans had issued an international arrest warrant for Bin Laden in April of 1988.

None of this should be construed as suggesting that Qaddafi was somehow a respectable partner for the United States, that he had American interests at heart when he made decisions, or that his rule over Libya was not ugly and brutal. But when the United States deals with dictatorial regimes worldwide, often it is a case of “better the devil you know than the one you don’t know.” The problem with overthrowing dictators in the Middle East is that, in most cases, the only truly organized opposition forces are Islamists. The United States learned this lesson in a particularly painful way when the Shah of Iran was overthrown in 1979 and this led to the rise of a brutal and aggressive Shi’a fundamentalist regime that transformed Iran from a staunch U.S. ally to one of America’s most significant adversaries.

Libya may not precisely follow Iran’s footsteps, but if Islamists do eventually dominate the new Libyan government, this will make Libya more of a threat to U.S. interests and allies than it was during the last decade of the Qaddafi regime. Moreover, an extended period of weak government and semi-chaos in Libya may lead to increased al-Qaeda-related activity in the country. While U.S. officials are saying that Libya’s stockpiles of chemical weapons and other components of weapons of mass destruction are secure, huge stockpiles of Libyan arms remain unaccounted for, including significant quantities of shoulder-fired surface-to-surface missiles – and the latter, if they end up in the wrong hands, could constitute an acute threat to homeland security.

In the final analysis, Libya, in and of itself, is not of critical significance in terms of overall U.S. policy in the region, but the country’s much larger neighbor to the east, Egypt, is of profound importance to Washington’s Middle East policy. There too, the overthrow of a dictator (who, in this case, was an ally of the West) may lead to Egypt playing a significantly less constructive rule (from the U.S. perspective) in the region and already seems to be leading to the strengthening of the Muslim Brotherhood and its affiliates and offshoots.

Of course, these dictatorships are gone and consequently the United States now has to initiate damage control and try to coax the successor regimes to maintain control of their territory (particularly to prevent that territory from becoming a base of operations for global Jihadi groups) and prevent excessive Islamist influence over the new political order. At the same time, there are still plenty of other dictators in the Middle East and Washington should think long and hard as to whether supporting human rights and the popular will in those countries really furthers American interests.