Although the Clinton administration’s debacle in Somalia in the early 1990s is most famous—as depicted in the Hollywood blockbuster Black Hawk Down—more recent American meddling by the George W. Bush and Barack Obama administrations may have worse long-term effects.

Even though George H.W. Bush’s and Clinton’s original intentions of protecting international food aid using U.S. forces might have been high-minded, they then engaged in mission creep—with Clinton eventually taking sides in the Somali civil war, chasing around a warlord who was in U.S. disfavor, and ignominiously withdrawing U.S. forces when the warlord killed a small number of U.S. Rangers in the “Black Hawk Down” incident.

Yet this embarrassing effort at failed Somali nation-building may pale in comparison to the potent ill consequences of meddling in that country by George W. Bush and Barack Obama. In early 2006, a fundamentalist Islamist movement called al-Shabaab had little Somali public support until the United States began backing corrupt and vicious warlords against the group. When interference by a foreign power caused the popularity of al-Shabaab to spike, Bush the Younger made things worse by sponsoring an invasion of the country by another foreign power—Ethiopia. Al-Shabaab survived this onslaught and threatened to oust the weak Somali government in the summer of 2009 after the Ethiopians withdrew their forces. The U.S. then hurriedly shipped millions of dollars of weapons to a government that is on life support and controls very little of the country, and only part of the capital of Mogadishu. As long as the United States intervenes in Somalia even indirectly, al-Shabaab can portray itself as battling the evil foreign infidels.

Had the George W. Bush and Obama administrations left Somalia alone after the George H.W. Bush and Clinton administration disaster, al-Shabaab would likely be only a local Islamist group without much Somali popular support. Traditionally, most Somalis have been moderate Muslims. Now the group controls most of Somalia and, in its animosity toward the United States, allegedly harbors high-level al-Qaeda operatives. Also, there is talk of a new “axis” between the al-Shabaab and al-Qaeda in the Arabian Peninsula, the group that sent the Christmas suicide bomber on the flight to the United States shortly after the U.S. sponsored a Yemeni government offensive against Islamists in that country just across the Gulf of Aden.

And these are not the only times that the United States has inadvertently created potent enemies. The CIA’s greatest “covert” success—helping the fundamentalist Islamist mujahideen defeat the Soviet Union in Afghanistan—was also its greatest failure. During the Cold War, the CIA encouraged Saudi Arabia to promote radical Islamism abroad as a counter to communism. In Soviet Afghanistan, the United States had funded the most extremist Islamist groups through the Pakistani intelligence services. That policy came back to severely bite the U.S. on 9/11—with an attack by al Qaeda, an anti-U.S. radical Muslim group originating from the anti-Soviet U.S. effort that was motivated to strike by U.S. interventions in and occupation of Islamic countries and was harbored by an Islamist Taliban Afghan government also arising from the U.S. effort. Was a communist defeat in backwater Afghanistan worth almost 3,000 dead in New York and Washington, the intense fear generated, the resultant erosion of the American Republic’s unique civil liberties, and the current U.S. nation-building quagmire to keep the Taliban from returning to power? No.

Yet even before this sorry episode, U.S. government overseas interference was laying the seeds for future antagonisms with Iran and Iraq. In 1953, the U.S. overthrew the freely elected Iranian government of Mohammed Mossadegh in favor of the autocratic shah, who became a longtime U.S. client. When Iranians became fed up with his despotic rule and overthrew him in the late 1970s, the new Islamist government had resented U.S. support for the shah and thus became an implacable U.S. foe. Because the new regime had held U.S. diplomats hostage for a long time and hated the United States, when aggressive Saddam Hussein attacked Iran, the U.S. provided militarily usable items, valuable satellite intelligence, and military planning expertise to him (some accuse the Carter administration of actually encouraging Saddam’s invasion of Iran in the first place). The bloody eight-year war ended with the advantage going to Saddam. Even after this war ended, the U.S. still backed the emboldened Saddam until he invaded Kuwait. The legacy of grinding economic sanctions and two U.S. wars against Saddam is a second U.S. occupation that is still sitting on a powder keg of ethno-sectarian animosities.

One might make the accusation of cherry-picking U.S. foreign policy failures and ignored the successes, but these failures are very significant and should be a cautionary tale as the U.S. sinks deeper into the Somali quicksand. The United States is aiding the upcoming offensive of an ineffectual and corrupt “friendly” Islamist government to retake the capital Mogadishu from the “unfriendly” Islamist al-Shabaab. Is this Afghan déjà vu all over again?