Isobel Coleman says the actions of Egypt's President Mohamed Morsy may help shape the outcome of the crisis in the region.

Editor’s Note: Isobel Coleman is the author of “Paradise Beneath Her Feet” and a senior fellow for U.S. foreign policy at the Council on Foreign Relations in New York.

Story highlights

Isobel Coleman: Origins of anti-American actions in Egypt, Libya were quite different

She says Egypt demonstration prompted by offensive anti-Muslim video

The Libya attack, which killed 4 Americans, was well-planned, by an armed group, she says

Coleman: Leaders have an opportunity to help prevent further bloodshed

CNN  — 

On Tuesday, protests rocked the American embassy compound in Cairo, while heavily armed militias overran the U.S. consulate in Benghazi, Libya, killing U.S. Ambassador Christopher Stevens and several others. The incidents initially seemed related, but they are in fact dramatically different developments.

In Egypt, a 2,000-strong crowd of protesters gathered in front of the U.S. Embassy to protest a film that depicts Islam in crude and offensive ways. The film is apparently being promoted by an Egyptian-American Coptic Christian now living in the United States and Terry Jones, the Florida pastor of “International Burn a Koran Day” infamy.

News: Six things to know about the attack

At the American embassy in Cairo, some protesters scaled the walls and in the courtyard were able to take down an American flag and put up a black Islamic flag associated with militant Islam.

Isobel Coleman

Why the Egyptian police, ever-present outside the American Embassy, allowed the protesters to progress that far is an unanswered question, although they – like the U.S. Marines guarding the embassy - might have reckoned that stronger action to stop the protest could have quickly escalated into violence.

The incident was eventually defused peacefully, and the Muslim Brotherhood has called for Egyptians to protest peacefully against the offensive film on Friday.

The Egyptian government is struggling to walk a fine line on this situation. On the one hand, the Egyptian public is deeply offended by the video and looks to its government to defend the faith. While President Morsy has made some lukewarm statements about the responsibility of the Egyptian government to protect diplomatic missions, he has issued much stronger words denouncing the film.

Indeed, he has demanded the United States take “all possible legal action” against the producers of the movie, an indication he does not fully understand our First Amendment. This is a widespread problem across the Arab world: People who have lived their lives largely under dictatorship simply cannot understand how a film can be made without government sanction. Their protest against the film is a protest against America.

Opinion: Extremists don’t speak for Libya

On the other hand, Egypt’s government is also well aware that ongoing street protests and any type of violence badly hurt its efforts to revive an economy that depends largely on tourism. The protests also could undermine international support. Egypt needs U.S. support for a $4.8 billion International Monetary Fund loan, and the United States is also considering forgiving $1 billion in Egyptian debt. As a statement from Egypt’s foreign ministry about the embassy protests correctly noted, “Such incidents will negatively impact the image of stability in Egypt, which will have consequences on the life of its citizens.”

Reports of what happened in Libya are still emerging, but it seems clear that the takeover of the consulate was a well-planned attack by a highly armed group. The protests against the video simply provided an expedient cover or perhaps were even coincidental with an attack planned for the anniversary of 9/11.

The success of the assault underscores the fragility of the security situation in Libya. Not only are there competing militias that have yet to relinquish their weapons, there are also various heavily armed jihadi groups determined to replace the state with an Islamic government. The attack in Benghazi was apparently planned and carried out by members of a “pro al Qaeda group,” perhaps in retaliation for the death of a Libyan al Qaeda member in June.

Although local forces tried to fire back, they were no match for the group’s guns, grenades, and by some accounts, rockets. Libya’s president condemned the violence, saying, “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.” However, it is unclear whether the government can respond effectively to the myriad security challenges it faces. To bolster Libyan capabilities, Washington is apparently sending reconnaissance drones over Libya to help hunt down the jihadi perpetrators.

The tragic violence in Libya and the unrest in Egypt raise the stakes on long-simmering tensions and issues. While debates over free speech and the role of religion in society have defined the Egyptian political scene in recent months, religious frictions between Egyptian Coptic Christians and Muslims are now at an important inflection point. The association of an Egyptian Copt with the offensive video is sure to inflame those tensions.

In Libya, the violence is yet another indication of competing visions for the future of the country, which, despite a successful national election in July, have not been resolved.

Opinion: Libya killings show U.S. at risk in Arab world

If history is anything to go by, we can expect difficult weeks ahead as protests against the video spread and likely erupt into violence in other places. In a notorious case beginning in 2005, cartoons negatively depicting the prophet Mohammed, published in a Danish newspaper, sparked uproar from Indonesia to Afghanistan to Morocco. At least 200 people lost their lives in unrest related to that controversy.

How much momentum the current video controversy generates will depend in no small on part on whether Islamic leaders in Egypt and other countries call for restraint or choose to fan the flames.

Follow @CNNOpinion on Twitter

Join us at Facebook/CNNOpinion

The opinions expressed in this commentary are solely those of Isobel Coleman.