(Reuters) – The U.S. ambassador to Libya and three embassy staff were killed in an attack on the Benghazi consulate and a safe house refuge, stormed by Islamist gunmen blaming America for a film they said insulted the Prophet Mohammad.

Gunmen had attacked and set fire to the U.S. consulate in the eastern city of Benghazi, the cradle of last year’s uprising against Muammar Gaddafi’s 42-year rule, late on Tuesday evening as another assault was mounted on the U.S. embassy in Cairo.

California-born ambassador Christopher Stevens was killed in the assault, but it was not clear how or where he died. U.S. consular staff were rushed to a safe house after the initial attack, Libya’s Deputy Interior Minister Wanis Al-Sharif said.

An evacuation plane with U.S. commandos units then arrived from Tripoli to evacuate them from the house.

“It was supposed to be a secret place and we were surprised the armed groups knew about it. There was shooting,” Sharif said. Two U.S. personnel were killed there, he said. Two other people were killed at the main consular building and between 12 and 17 wounded.

The attack raised questions about the future U.S. diplomatic presence in Libya, relations between Washington and Tripoli, the unstable security situation in post-Gaddafi Libya and whether more protests might erupt in the Muslim world over the film.

The amateurish film, promoted by a U.S. pastor, portrayed Mohammad as a fool, a philanderer and a religious fake. In one clip posted on YouTube, Mohammad was shown in an apparent sex act with a woman.

For many Muslims it is blasphemous to depict the Prophet and the incident had echoes of the publication in a Danish newspaper of cartoons that touched off riots in the Middle East, Africa and Asia in 2006 in which at least 50 people died.

U.S. President Barack Obama, whose administration supported the Libyan insurgency with funds, weapons and training, branded the killing an “outrageous attack” and ordered increased security at U.S. diplomatic posts worldwide.

“SMALL AND SAVAGE GROUP”

U.S. Secretary of State Hillary Clinton said the attack was the work of a “small and savage group” not the government or people of Libya.

Descriptions of the consulate attack described chaos and bloodshed, with Libyan security over-run and retreating.

“We started shooting at them, and then some other people also threw hand-made bombs over the fences and started the fires in the buildings,” said 17-year-old Hamam, who took part in the assault and refused to give his last name.

“There was some Libyan security for the embassy outside but when the hand-made bombs went off they ran off and left,” said Hamam, who said he saw an American die in front of him in the mayhem that ensued. He said he his body was covered in ash.

The attack was believed to have been carried out by Ansar al-Sharia, an al Qaeda-style Sunni Islamist group that has been active in Benghazi, a Libyan security official said. Witnesses said the mob also included tribesmen, militia and other gunmen.

Ansar al-Sharia cars arrived at the start of the protest but left once fighting started, Hamam said. “The protesters were running around the compound just looking for Americans, they just wanted to find an American so they could catch one.”

On Wednesday, the sprawling, leafy compound in Benghazi stood empty, with passers-by freely walking in to take a look at the damage and the heat of the fires could still be felt.

Walls were charred and a small fire burned inside one of the buildings with glass from shattered chandeliers on the floor. A small group of men was trying to extinguish the flames and three security men briefly surveyed the scene.

A Reuters reporter saw chairs, table and food lying alongside empty shells. Some blood stains could also be seen in front of one of the buildings. Three cars were burnt out.

Benghazi residents argued among themselves about whether the attack was right or wrong.

One man, walked by and simply said: “We showed the Italians in 2006 and now the Americans saw what we did.” He was referring to the storming of the Italian embassy over a perceived insult to Islam.

UNPREPARED FOR HEAVY ATTACK

“The Libyan security forces came under heavy fire and we were not prepared for the intensity of the attack,” said Abdel-Monem Al-Hurr, spokesman for Libya’s Supreme Security Committee.

Western leaders and officials joined condemnation of Tuesday’s assault as did Lebanon’s Shi’ite militant group Hezbollah.

A Danish newspaper caused a storm of protest across Islamic nations in 2005 by printing cartoons lampooning Islam and the Prophet Mohammad in 2005, the most famous depicted him wearing a bomb in his turban.

Afghan President Hamid Karzai sharply condemned the film in a statement, calling its making a “devilish act”, saying he was certain those involved in its production represented a very small minority.

Afghanistan shut down the YouTube site so Afghans would not be able to see the film.

U.S. ambassadors in such volatile countries as Libya are accompanied by tight security, usually travelling in well-protected convoys. Diplomatic missions are usually protected by Marines or other special forces.

Stevens grew up in California, graduated from Berkeley and worked in North Africa as a Peace Corps volunteer. He taught English in Morocco before joining the foreign service where he worked in the Middle East and North Africa.

Airport sources said the bodies were due to be flown from Benghazi to Tripoli.

Libya’s interim government has struggled to impose its authority on a myriad of armed groups that refused to lay down their weapons and often take the law into their own hands.

Security experts say the area around Benghazi is host to a number of Islamist militant groups who oppose any Western presence in Muslim countries.

The worst-case scenario for Western governments is that a spate of recent attacks could be the start of an Iraq-style insurgency by Islamist militants. That could have an impact on oil exports as the energy sector depends on foreign workers.

However, security analysts say an insurgency is unlikely to gain the kind of traction it had in Iraq, mainly because Western states have no military presence on the ground in Libya.

Libyan Deputy Prime Minister Mustafa Abu Shagour condemned the killing of the U.S. diplomats as a cowardly act. The head of Libya’s national assembly vowed to bring the killers to justice.

U.S. PASTOR

U.S. pastor Terry Jones, who had inflamed anger in the Muslim world in 2010 with plans to burn the Koran, said he had promoted “Innocence of Muslims”, which U.S. media said was produced by an Israeli-American property developer.

Jones, a pastor in Florida whose latest stunt fell on the anniversary of the September 11, 2001, attacks on the World Trade Center and the Pentagon, triggered riots in Afghanistan in 2010 with his threat to burn the Koran.

Many Muslims consider any depiction of the Prophet as offensive and any depiction of him can cause furious protests in the Islamic world as well as among Muslims in Europe.

In neighboring Egypt, demonstrators had torn down an American flag and burned it during a protest against the film. Some tried to raise a black flag with the words “There is no God but God, and Mohammad is his messenger”.

The crowd of around 2,000 protesters in Cairo protesting against the film was a mixture of Islamists and teenage soccer fans known for fighting police and who played a part in the revolt that toppled Egypt’s leader Hosni Mubarak last year.

Egypt’s Coptic Orthodox Church condemned in a statement some Copts living abroad who it said financed “the production of a film insulting the Prophet Mohammad”, an Egyptian state website said. About a 10th of Egypt’s 83 million people are Christian.

The fortress-like U.S. mission in Cairo is near Tahrir Square, where Egypt’s uprising began and the scene of many protests since. Youths danced and chanted football songs. A Reuters reporter said they appeared to climb into the embassy compound almost as an afterthought.

“We sacrificed dozens and hundreds during the uprising for our dignity. The Prophet’s dignity is more important to us and we are ready to sacrifice millions,” said mosque preacher Mohamed Abu Gabal who joined the protest.