Ambassador and three staff killed during attack in eastern Libya city over film deemed insulting by Muslims.

The US ambassador to Libya and three other American staffers died on Tuesday night in an attack on the US consulate in the eastern city of Benghazi, US officials have said.

An armed mob attacked and set fire to the consulate building during a protest against an amateur film deemed offensive to Islam’s prophet, Muhammad, after similar protests in Egypt’s capital.

The two incidents came on the 11th anniversary of the September 11, 2001 al-Qaeda attacks in the US.

The US government confirmed that Ambassador Chris Stevens and information technology officer Sean Smith, in addition to two unnamed personnel, died in the attack. Libyan security source told Al Jazeera that Stevens died from smoke inhalation.

US President Barack Obama and Secretary of State Hillary Clinton pledged to bring the attackers to justice in public remarks on Wednesday morning and said the attack would not break the bonds between the United States and Libya.

In a press conference, Libyan Prime Minister Abdurrahim al-Keib said the government “will do all in our power to respond to this incident in order for all the perpetrators to be arrested and penalised.”

Mustafa Abushagour, the deputy prime minister, called the killings “an attack on America, Libya and the free world”.

US officials said a team of roughly 50 specialised rapid response Marines trained in protecting government personnel abroad had been dispatched to reinforce security in Libya.

Stevens was paying a short visit to the city when the consulate came under attack, Al Jazeera’s Suleiman El-Dressi reported from Benghazi.

Two staff members were injured, El-Dressi reported. Up to 10 Libyan security guards who battled the attackers also died, said Ibrahim Dabbashi, Libya’s envoy to the United Nations.

Clinton and Obama praised the Libyans who attempted to defend the consulate and brought Stevens’s body to a hospital, where a doctor reportedly tried to revive him for 90 minutes.

Attack appeared ‘planned’

Libyan Deputy Interior Minister Wanis al-Sharif blamed loyalists of former Libyan ruler Muammar Gaddafi for the attack, while stressing that the United States should have removed its personnel from the country when news of the film’s release broke.

“It was necessary that they take precautions. It was their fault that they did not take the necessary precautions,” he said.

Sharif cited protests that broke out earlier this summer when al-Qaeda second-in-command and Libyan citizen Abu Yahya al-Libi was killed in a US drone strike in Pakistan. On Tuesday, in a little-noticed development, al-Qaeda chief Ayman al-Zawahiri publicly confirmed Libi’s death.

Quilliam, an British think tank that aims to oppose Muslim extremism, asserted on Wednesday that the attack on the consulate was not part of a protest but a “planned terrorist assault” to avenge Libi’s death.

Quilliam said that the evidence pointing to such a conclusion came from witness statements that those outside the consulate were carrying RPGs and that the assault came in two apparently calculated waves, the second of which targeted the Americans after they had fled the consulate for a safe house.

Sharif said that those who attacked the consulate were more heavily armed that the Libyan security services tasked with protecting the embassy. The group Ansar al-Sharia, or Supporters of Islamic Law, had initially been blamed for the attack but claimed in a press conference on Wednesday morning that it did not take partm, thought it did support the action.

The bodies of the dead were transported to the Benghazi airport, to be flown to Tripoli and then onwards to a major US airbase in Germany.

On Wednesday morning, the compound stood empty, with passersby freely walking in to take a look at the damage. Walls were charred and a small fire burned inside one of the buildings. A small group of men was trying to extinguish the

flames and three security men briefly surveyed the scene.

Some blood stains could also be seen in front of one of the buildings. Three cars were torched.

Stevens, a career member of the US foreign service, arrived in Tripoli to take up the post of ambassador in May 2012, having served for years in Libya.

He was the US government’s representative to the opposition National Transitional Council during the 2011 uprising against the government of Muammar Gaddafi and had previously been the second-ranking US diplomat in Libya.

Mystery film

The origins of the film, supposedly called “Innocence of Muslims,” remained shrouded in uncertainty on Wednesday. At least two news organisations quoted a man calling himself Sam Bacile, who said he was a 52-year-old Israeli-American from California who had written, produced and directed the film with $5 million in donations from “100 Jews”.

Bacile said he was a real estate developer, but no online trace of Bacile or his occupation could be found. Steve Klein, a right-wing Christian activists in California who has been described as a consultant to the film, told the Atlantic magazine that he had met Bacile, and that the man was not Israeli, probably not Jewish and likely using a pseudonym.

The film was promoted by Morris Sadek, an extreme anti-Muslim Egyptian Christian who lives in California.

Speaking by phone to the Associated Press from an undisclosed location, the man calling himself Bacile remained defiant, maintaining that he intended his film to be a provocative political statement.

Bacile admitted he had not anticipated such a furious reaction to his film and said: “I feel sorry for the embassy. I am mad”.

He also said the film was produced in English and that he did not know who had dubbed it in Arabic. The full film has not been shown yet, he said, and he said he had declined distribution offers for now.

Lukewarm reaction in Cairo

Just hours earlier on Tuesday, thousands of Egyptian demonstrators apparently angry over the same film – a video produced by expatriate members of Egypt’s Coptic community resident in the US – tore down the US flag at the embassy in Cairo and replaced it with a black Islamic flag.

While Tunisian President Moncef Marzouki was quoted as describing the Benghazi attack as a “terrorist act,” the recently elected government of Egyptian President Mohamed Morsi offered a lukewarm response.

In a statement, Morsi condemned the film’s portrayal of Muhammed while stressing that the Egyptian government had a responsibility to guard diplomatic premises.

Al Jazeera’s Sherine Tadros reports on the demonstrations in Cairo

Nearly 3,000 demonstrators, many of them supporters of the ultraconservative Salafist movement, gathered at the US embassy in Cairo in protest against the amateur film.

A dozen men scaled the embassy walls and one of them tore down the US flag, replacing it with a black one inscribed with the Muslim profession of faith: “There is no God but God and Muhammad is the messenger of God.”

Demonstrators also scrawled the first part of the statement “There is no God but God” on the walls of the embassy compound.

Al Jazeera’s Sherine Tadros, reporting from outside the US embassy in Cairo, said that the protesters want the film – portions of which can be found online – “out of circulation”.

“Most of the people I’ve spoken to here … say that they’ve seen the trailer to this film and that they’re here outside the American embassy to stay until the film is pulled,” she said.

Egyptian police intervened without resorting to force and persuaded the trespassers to come down.

The crowd then largely dispersed, leaving just a few hundred protesters outside the US mission.