By Tamim Elyan and Omar al-Mosmari
CAIRO/BENGHAZI, Libya (Reuters) - Protesters in Egypt and Libya attacked U.S. diplomatic missions on Tuesday in a spasm of violence that led to the death of a State Department officer at the consulate in the Libyan city of Benghazi after fierce clashes at the compound.
U.S. Secretary of State Hillary Clinton, in a statement late on Tuesday, confirmed the death of the U.S. diplomat, who was not identified, and condemned the attack on the Benghazi consulate, after a day of mayhem in two countries that raised fresh questions about Washington's relations with the Arab world.
The violence in Benghazi followed protests in neighboring Egypt where protesters scaled the walls of the Cairo embassy and tore down the American flag and burned it during protests over what demonstrators said was a U.S. film that insulted the Prophet Mohammed.
On Tuesday, Egypt's prestigious Al-Azhar mosque and seat of Sunni learning condemned a symbolic "trial" of the Prophet organized by a U.S. group including Terry Jones, a Christian pastor who triggered riots in Afghanistan in 2010 by threatening to burn the Koran.
But it was not immediately clear whether it was the event sponsored by Jones, or another, possibly related, anti-Islam production, that prompted the melee at the U.S. Embassy in Egypt, and possibly the violence in Libya.
Whatever the cause, the events appeared to underscore how much the ground in the Middle East has shifted for Washington, which for decades had close ties with Arab dictators who could be counted on to muzzle dissent.
U.S. President Barack Obama's administration in recent weeks had appeared to overcome some of its initial caution following the election of an Islamist Egyptian president, Mohamed Mursi, offering his government desperately needed debt relief and backing for international loans.
In Libya, gunmen in Benghazi attacked the U.S. diplomatic compound on Tuesday evening, clashing with Libyan security forces, officials said.
Abdel-Monem Al-Hurr, spokesman for Libya's Supreme Security Committee, said, "There is a connection between this attack and the protests that have been happening in Cairo."
But a U.S. official in Washington, speaking on condition of anonymity, said he had no reason to believe the two incidents were linked.
Jones, the Christian pastor in Florida, said that on Tuesday's anniversary of the September 11, 2001, attacks on the World Trade Center and the Pentagon, he had released a video promoting a film that portrayed the Prophet in a "satirical" manner. Many Muslims consider any depiction of the Prophet offensive.
U.S. media, including The Wall Street Journal, reported that the film at issue, entitled "Innocence of Muslims," was produced by an Israeli-American real estate developer, but had been promoted by Jones.
In Cairo, among about 2,000 protesters gathered in the Egyptian capital was Ismail Mahmoud, who, like others, did not name the film that angered him, but called on Mursi, Egypt's first civilian president, to take action.
"This movie must be banned immediately and an apology should be made," said the 19-year-old Mahmoud, a member of the "ultras" soccer supporters who played a big role in the uprising that brought down Hosni Mubarak last year.
Once the U.S. flag was hauled down in Cairo, some protesters tore it up and displayed bits to television cameras. Others burned the remnants outside the fortress-like embassy building in central Cairo. But some protesters objected to the flag burning.
In Benghazi, Reuters reporters on the scene could see looters raiding the empty U.S. consulate's compound, walking off with desks, chairs and washing machines.
Unknown gunmen were shooting at the buildings, while others threw handmade bombs into the compound, setting off small explosions. Small fires were burning around the compound.
Passersby entered the unsecured compound to take pictures with their mobile phones and watch the looting.
No security forces could be seen around the consulate and a previous blockade of the road leading to it had been dismantled.
"The Libyan security forces came under heavy fire and we were not prepared for the intensity of the attack," Hurr said.
Libya's interim government has struggled to impose its authority on a myriad of armed groups that have refused to lay down their weapons and often take the law into their own hands.
A number of security violations have rocked Benghazi, Libya's second biggest city and the cradle of last year's revolt that toppled Muammar Gaddafi.
The breaching of the U.S. Embassy walls in Cairo comes at a delicate time in U.S.-Egyptian relations, and as the United States appeared to be trying an intensified engagement with Mursi's government.
Last week, U.S. officials said they were close to a deal with Egypt's government for $1 billion in debt relief. Washington had also signaled its backing for a badly needed $4.8 billion loan that Egypt is seeking from the International Monetary Fund.
"I would urge you not to draw too many conclusions because we've also had some very positive developments in our relationship with Egypt," State Department spokeswoman Victoria Nuland said.
"One of the things about the new Egypt is that protest is possible," she said. "Obviously we all want to see peaceful protest, which is not what happened outside the U.S. mission, so we're trying to restore calm now."
Washington has a large mission in Egypt, partly because of a huge aid program that followed Egypt's signing of a peace treaty with Israel in 1979. The United States gives $1.3 billion to Egypt's military each year and offers the nation other aid.
Following the protest, Egypt's Foreign Ministry said it was committed to giving all embassies the protection they needed.
(Additional reporting by Hadeel Al Shalchi in Tripoli, Sarah N. Lynch and Arshad Mohammed in Washington, and Reuters reporters in Cairo and Benghazi; Writing by Edmund Blair and Warren Strobel; Editing by Michael Roddy and Peter Cooney)