A Libyan security official reported an American was shot to death as protesters burned the U.S. consulate in Benghazi, and in Cairo, protesters scaled the U.S. Embassy walls and replaced a U.S. flag with an Islamic banner.
It was the first assaults on U.S. diplomatic facilities in either nation, at a time when Libya and Egypt are trying to overcome the turmoil after the ousters of their longtime leaders, Moammar Gadhafi and Hosni Mubarak, in uprisings last year.
In Benghazi, a large mob stormed the U.S. Consulate, with gunmen firing weapons, said Wanis al-Sharef of the Interior Ministry.
A witness said attackers fired automatic weapons and rocket-propelled grenades at the consulate as they clashed with Libyans hired to guard the facility. Outnumbered by the crowd, Libyan security forces did little to stop them, Mr. al-Sharef said.
The crowd overwhelmed the facility and set fire to it, burning most of it and looting the contents, witnesses said.
One American was shot to death and a second was wounded, Mr. al-Sharef said.
The U.S. State Department did not refer to any deaths but did issue a statement. "We can confirm that our office in Benghazi, Libya, has been attacked by a group of militants. We are working with the Libyans now to secure the compound. We condemn in strongest terms this attack on our diplomatic mission."
In Cairo, thousands of demonstrators stormed the U.S. Embassy, lowered the American flag and destroyed it, then danced atop the walls in a protest that lasted hours.
Police in Cairo surrounded the Embassy but made no move to confront the demonstrators as they sprayed graffiti on the 12-foot walls that encircle the compound.
One protester tested his spray can on a policeman's shield before aiming it at the wall; the officer just shrugged. Police made no move as protesters lowered the American flag. As the flag was torn and then set on fire, a man climbed a ladder alongside the flagpole and replaced the flag with one that read, "There is no God but Allah and Mohammed is his messenger."
Among the chants yelled toward the Embassy was, "Take a picture, Obama, we are all Osama," a reference to Osama bin Laden, who planned and financed the 9/11 attacks and whom U.S. commandoes killed on May 2, 2011.
"Say it, don't fear: Their ambassador must leave," was another.
The protesters replaced the U.S. flag with an Islamic banner similar to the one used by al-Qaeda.
State Department officials said their employees in Egypt were not in danger. Most had gone home early in anticipation the protesters would scale the wall around 5 p.m.
Organizers of the protest said they'd begun planning the event last week when a controversial Egyptian Christian activist who lives in the United States, Morris Sadek, released a trailer for a movie called Mohammed that mocks the prophet and the religion.
The 14-minute clip, which Mr. Sadek posted on his Facebook page Sept. 5, attacked basic tenets of Islam and suggested the religion had spread only because the prophet told those he encountered to "pay extortion or die" if they didn't convert.
Christians make up roughly 10 percent of Egypt's population. Officials from Egypt's Coptic churches have condemned the film.
The Embassy had tried to pre-empt the attack, issuing a statement hours earlier that condemned "the actions by those who abuse the universal right of free speech to hurt the religious beliefs of others."
Nader Bakkar, a spokesman for the conservative Islamist Nour party, said he'd received a call from the Embassy, apologizing for the film clip, but that it wasn't enough for him to call off the protest. Insulting the prophet "goes beyond a red line for us," he said.
"The American people must know we do not accept any kind of insult of the prophet, peace be upon him," Mr. Bakkar said, adding that he opposed pulling down the American flag.
Islam forbids any depiction of Mohammed because he's seen as someone whose greatness can't be replicated. In documentaries about his life, he's often portrayed as a ray of light. That someone would mock the prophet is considered blasphemous.
By midnight, the crowd had dwindled.
The U.S. Embassy said on its Twitter account that there will be no visa services today because of the protests.
A senior Egyptian security official at the Embassy area said authorities allowed the protest because it was "peaceful."
When they started climbing the walls, he said he called for more troops, denying the protesters stormed the Embassy. He spoke on condition of anonymity.
A YouTube spokesman said the Web site would not take down the video at this point. The spokesman said the Web site's policy is to remove videos that include a threat of violence, but not those only expressing opinions.
"We take great care when we enforce our policies and try to allow as much content as possible while ensuring that our Community Guidelines are followed," the YouTube representative said. "Flagged content that does not violate our guidelines will remain on the site."
Sam Bacile, an American citizen who said he produced, directed, and wrote the two-hour film, said he had not anticipated such a furious reaction.
"I feel sorry for the Embassy. I am mad," Mr. Bacilesaid.