By David Ignatius - September 13, 2012

WASHINGTON -- What's happening on the ground in Cairo and Benghazi appears to be a case of political opportunism -- no, not by Mitt Romney, though there was some of that Wednesday -- but by Salafist Islamic extremists who are unhappy with the success the more moderate Islamist and secularist parties in Egypt and Libya have had in building political support.

We're still in what I like to call the "fog of revolution" in both countries, where it's hard to know for sure what's happening and who benefits, so my reporting comes with a basic caveat. But based on conversations with sources who were on the streets Tuesday in the midst of the Cairo demonstration, and who have been following events in Libya closely, it's possible to pierce the fog a bit and offer some basic analysis:

First, the situation in Cairo: The Arabic banners of the protesters moving toward the U.S. Embassy identified them as members of the Nour Party and the Asala Party, the two leading Salafist groups that have competed in the Egyptian elections. The Salafists, whose name connotes respect for the Islamic "ancestors" of the Prophet Muhammad's time, are more conservative and less pragmatic than the Muslim Brotherhood that is now ruling Egypt.

An analyst who was in the midst of that crowd Tuesday told me he thinks the Salafist demonstrators were using the pretext of a supposedly anti-Islamic American film to send two messages: the first was obviously anti-Americanism, which is potent in today's Egypt; the second and more interesting message was a challenge by the Salafists to their rivals in the Muslim Brotherhood government of President Mohamed Morsi.

As is so often the case in revolutions, the Cairo uproar appears to be partly a case of radicals wanting to undermine a more moderate governing party. The Salafist demonstrators' threat was augmented by violent hooligans, who are often described as soccer fans but increasingly are inflammatory anarchists.

A similar process of post-revolutionary jockeying is going on in Libya, and it tragically led to the death Tuesday of Ambassador J. Christopher Stevens and three other Americans. The Salafists' assault on the U.S. Consulate in Benghazi at first appeared to be a "copycat" attack like the one in Cairo, but U.S. officials said it may have been planned by extremists linked to al-Qaeda. They were augmented by a well-armed Islamic militia. Their anger, again, is mixed between a baseline anti-Americanism (sadly, always a draw in the region) and a challenge to Prime Minister Abdurrahim el-Keib and the secularist parties that are the backbone of the new Libyan government.

Does America have an interest in the internal fights taking place in these countries still quaking from the Arab uprisings? Yes, of course it does, especially when U.S. embassies are targets of protesters and American diplomats get killed in the crossfire. But this isn't really about America: It's about different factions battling for power in a fluid political situation.

Unfortunately, the seizure of the U.S. embassy in Tehran in 1979 is an apt parallel. That was the work of a group of extremist Iranian "students" who were unhappy that the post-revolutionary government of Ayatollah Ruhollah Khomeini wasn't proving radical enough. They captured the revolution when they seized the embassy. The lesson of that disaster is that local security authorities must quickly restore order -- and if they can't or won't, then Americans must move out of harm's way.

Also worrisome is the link between Salafists (whose posters disturbingly appear in Cairo neighborhoods near Heliopolis populated by members of the military) and the more violently "takfiri" wing, which believes it's permissible to kill apostate Muslims, and has links with al-Qaeda. The takfiris hate the ruling Muslim Brotherhood, if that's any consolation.

The delicate political balance in Egypt and Libya makes the blunderbuss campaign rhetoric of Romney, the Republican presidential candidate, especially unfortunate. His comments make this crisis more "about America" than it needs to be.

Let's return to the main trigger for these events: It's the success of the tolerably non-extremist (I won't say "moderate") governments in Egypt and Libya in consolidating power, and the anger of the more radical Salafists at this success. Morsi, for example, has just won pledges of billions in financial support from Saudi Arabia and Qatar. The Gulf Arabs are making a bet that over the next year, Morsi can stabilize Egypt and get the economy moving again. Despite Tuesday's tragic events, the U.S. should make the same bet.