Americans could be forgiven this week for having an awful feeling of déjà vu. On the anniversary of 9/11, Egyptian protesters scaled the walls of the U.S. Embassy in Cairo, tore down the American flag, and replaced it with a black one that bears an uncomfortable resemblance to al Qaeda’s trademark pennant. "Obama, Obama there are still a billion Osamas," chanted the mix of ultraconservative Salafi Muslims and soccer hooligans, known as "ultras," who claimed to be protesting a U.S.-made film that insults the Prophet Mohammed.

A little less than 700 miles to the west, Libyan militants who claimed to be equally incensed by the film — allegedly produced by an obscure Israeli-American filmmaker who is now in hiding— overran the U.S. consulate in Benghazi and set it ablaze. U.S. Ambassador Christopher Stevens and three other Americans died in a rocket attack on their vehicle as they attempted to flee the compound, according the Washington Post’s version of the story.It was the first killing of a U.S. ambassador since 1979, when Adolf Dubs was kidnapped and shot by radical militiamen in a Kabul hotel.

Against the backdrop of the Arab Spring and the subsequent rise of Islamists across much of the Middle East, Tuesday’s events can’t help but call to mind the outpouring of anti-American sentiment of that earlier era. By late 1979, a toxic mix of Iranian anti-Americanism, Saudi petrodollars, and conspiracy theorizing touched off a wave of attacks on U.S. embassies across the Muslim world. The first — and most chronicled — attack occurred on Nov. 4, when radical Iranian students, upset by President Jimmy Carter’s decision to let the deposed shah seek medical treatment in the United States, overran the U.S. Embassy in Tehran and took 63 Americans hostage. (Three more hostages were taken at the Iranian Foreign Ministry, but 14 were eventually released, bringing the total number to 52.) During the subsequent 444-day standoff, resentment toward American "imperialism" continued to fester and U.S. embassies in the Muslim world began to look increasingly like sitting ducks.

The embassy seizure in Iran was actually just one of several such attacks across the Muslim world that year. When Saudi Arabian militants led by Juhayman al-Utaybi, seized the Grand Mosque in Mecca on Nov. 20, many across the region instinctively blamed the United States and Israel — the two most popular targets of Iranian vituperation and the source of perceived humiliation for many. That morning, Saudi Arabian officials declined to identify the perpetrators and Radio Tehran happily supplied its own narrative: "It is not far-fetched to assume that this act has been perpetrated by the criminal American imperialism so that it can infiltrate the solid ranks of Muslims by such intrigues."

In Pakistan, where General Zia ul Huq was actively courting young firebrand Islamists to shore up his political base, the students at Quaid-i-Azam University in Islamabad reached the same conclusion. Clamoring by the busload to the U.S. Embassy, radical student members of Jamaa-e-Islami, some of whom were armed, quickly breached the compound, killing one Marine and taking another American hostage. The students proceeded to set fire to the embassy, forcing the staff to take refuge in the code room vault while the compound burned around them. Finally, after the Americans had spent more than five hours in the blistering heat of the vault, Pakistani troops arrived from their headquarters in Rawalpindi, not half an hour’s drive from the embassy, and the crowds melted away.

The attack was a close call for the United States. As Steve Coll notes in Ghost Wars, "Had events taken a slight turn for the worse, the riot would have produced one of the most catastrophic losses of life in U.S. diplomatic history." But the wave of anti-Americanism had not yet crested and it would be less than two weeks before radicals lashed out against the United States again — this time in Libya.

On Dec. 2, throngs of students began assembling outside the U.S. Embassy in Tripoli, chanting "Death to America" and burning President Carter in effigy. After the embassy staff, led by CIA station chief Jack McCavitt, managed to escape through an adjacent apartment complex, Libyan students and security officials stormed the compound, carting away boxes of documents they believed to be sensitive. According to Yaroslav Trofimov’s The Siege of Mecca, however, the Libyans got mostly cashiers’ records, publicly accessible Foreign Service regulations, and the embassy’s "Learn a Foreign Language" tapes in Italian.

But if there were an ounce of humor in the Libyan fiasco, it was eclipsed by the immediacy of the Iranian threat and the seriousness of America’s image problem in the Muslim world. "[T]he Iranian revolution was not isolated," as Trofimov put it. "The fervent anti-American propaganda coming out of Tehran was making Muslims worldwide see the U.S. as the enemy of their faith." And worse than that, radicals were learning that there was little price to be paid for standing up to the Americans. As the historian Bernard Lewis recalled, "If you said or did anything against the Americans, not only would there by no punishment, but there might even be some reward."

The question now, as the world tries to make sense of the fresh wave of anti-American attacks sweeping across the Middle East, is whether the United States faces anything like the ideological force it stared down in 1979. For now, the answer appears to be no. In 1979, the success of the Iranian revolution breathed new life into Islamist movements across the world that dreamed of establishing an Islamic state. Even Sunni extremist groups, whose puritanical "petro-Islam" was anathema to the revolutionary Shiite fervor emanating from Tehran, were jolted awake by Ayatollah Khomeini’s meteoric rise. Establishing an Islamic state independent of the West no longer felt like a distant possibility.

Today, that experiment has clearly failed. Those who still seek to reestablish a caliphate — al Qaeda and a smattering of fringe Islamist organizations — are struggling to remain relevant in the post-Arab Spring world. The advent of democracy in parts of the Middle East and the triumph of mainstream Islamists in Egypt and Tunisia portends a very different future than what Khomeini envisioned in 1979. In such an environment, anti-Americanism will doubtlessly remain a fact of life — particularly because of its political salience in nascent democracies. But the days when extremist ideologues preaching "death to America" could attract university students by the thousands across the Muslim world might well be over.

The circumstances of Tuesday’s attacks provide further reassurance that this is not 1979 all over again. In Egypt, the ranks of demonstrators swelled outside the embassy only after football "ultras" — upset that Egypt’s Premier League season had been delayed a month following their attack on the Egyptian Football Association’s headquarters — opted for an alternative venue to vent their frustrations. (A video posted on the Facebook page of Egypt’s Al-Hekma channel, titled "Ultras Zamalek tear the American flag in front of the embassy," shows the football faithful gleefully scaling the flagpole.)

The attack in Libya, moreover, while certainly more worrisome because of its deadly consequences, probably has more to do with the new government’s inability to control local militias than with anti-Americanism run amok. Indeed, Libyan officials from across the political spectrum condemned the attack, with President Mohamed Magariaf leading the way: "We refuse that our nation’s lands be used for cowardice and revengeful acts. It is not a victory for God’s sharia or his prophet for such disgusting acts to take place," he said. "We apologize to the United States, the people of America, and the entire world. We and the American government are standing on the same side, we stand on the same side against outlaws."

It is a far cry from the tirade broadcast by the official Libyan Jamahiriya News Agency following the embassy attack in Tripoli nearly 33 years ago: "Upon the students’ breaking into the embassy, the staff fired toxic gases believed to be used only by the military, confirming that the embassy employees are military personnel," railed the radio broadcaster, who went on to blame the Americans for the "injury of several Libyan students." For all the instability and chaos of the Middle East today, here’s the good news: It’s not 1979 anymore.