The US ambassador to Libya, Christopher Stevens, has died from smoke inhalation in an attack on the US consulate in the eastern Libyan city of Benghazi, the country's interior ministry and security sources have said.
An armed mob attacked and set fire to the building in a protest against an amateur film deemed offensive to Islam's Prophet Muhammad, after similar protests in Egypt's capital.
The ambassador was paying a short visit to the city when the consulate came under attack on Tuesday night, Al Jazeera's Suleiman El-Dressi reported from Benghazi.
He died of suffocation during the attack, along with two US security personnel who were accompanying him, security sources told Al Jazeera. Another consulate employee, whose nationality could not immediately be confirmed, was also killed.
Two other staff were injured, El-Dressi reported. The deaths were confirmed by Wanis al-Sharif, the Libyan deputy interior minister, to the AFP news agency.
Addressing a press conference, Sharif blamed loyalists of former Libyan ruler Muammar Gaddafi for the attack, while stressing that the US should have removed its personnel from the country when news of the film's release broke.
"They are to blame simply for not withdrawing their personnel from the premises, despite the fact that there was a similar incident when [al-Qaeda second-in-command and Libyan citizen] Abu Yahya al-Libi was killed. It was necessary that they take precautions. It was their fault that they did not take the necessary precautions," he said.
Sharif said that those who attacked the consulate were more heavily armed that the Libyan security services tasked with protecting the embassy.
Mustafa Abu Shagur, the Libyan deputy prime minister, condemned the "cowardly act of attacking the US consulate and the killing of [the ambassador] and the other diplomats".
Abdel Moneim al-Yasser, a member of the interim committee monitoring security in Libya, told Al Jazeera: "A handful of renegades of people who are attacking the national interests of Libya are behind this issue. We are still investigating on their identity [...] we will track them and bring them to justice."
The bodies of the dead were transported to the Benghazi international airport, to be flown to Tripoli and then onwards to a major US airbase in Germany.
Abdel Moneim al-Hurr, a spokesman for Libya's Supreme Security Committee, said on Wednesday that rocket-propelled grenades had been fired at the consulate from a nearby farm.
"There [were] fierce clashes between the Libyan army and an armed militia outside the US consulate," he said. He also said roads had been closed off and security forces surrounded the building.
A group calling themselves the "Islamic law supporters" carried out the attack in response to the release of the film, Al Jazeera's El-Dressi reported.
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 previously served twice previously in Libya. He had also served as the US government's representative to the Libyan National Transitional Council (NTC) during the 2011 uprising against the government of Muammar Gaddafi.
In a statement, US President Barack Obama condemned the killing and said that he had ordered security at all US diplomatic posts to be increased.
Mohammed al-Magariaf, the president of the Libyan general congress, also condemned the attack, saying that it was part of a campaign "to impede our democratic experiment". He blamed "remnants of the Gaddafi regime" for the attacks.
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 Stars and Stripes at the US embassy in Cairo and replaced it with a black Islamic flag.
The two incidents came on the 11th anniversary of the September 11, 2001 attacks in the US.
"Some have sought to justify this vicious behaviour as a response to inflammatory material posted on the internet," said a statement by Hillary Clinton, the US secretary of state, who had earlier confirmed the death of a consulate employee, but not specified his identity.
"The United States deplores any intentional effort to denigrate the religious beliefs of others," she said.
In the day's first such incident, nearly 3,000 demonstrators, most of them Islamist supporters of the Salafist movement or football fans, 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, a lot of them from the ultra-conservative Salafi movement, 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.
"There's also a situation with the police, where there are thousands of riot police guarding the American embassy because there of the breach earlier on, when a lot of people stormed into the inner wall of the embassy and put a black flag up."
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.
When asked whether the flag the protesters hoisted was an al-Qaeda flag, on the anniversary of the killing of nearly 3,000 people in Washington, New York and Pennsylvania, a US state department official said she thought not.
"We had some people breach the wall, take the flag down and replace it. What I heard was that it was replaced with a plain black flag. But I may be not be correct in that," she said.
"In Cairo, we can confirm that Egyptian police have now removed the demonstrators who had entered our embassy grounds earlier today," said a senior State Department official, who added that he could not confirm any connection with the incident in Libya.
Egyptian activist Wael Ghoneim wrote on his Facebook page that "attacking the US embassy on September 11 and raising flags linked to al-Qaeda will not be understood by the American public as a protest over the film about the prophet.
"Instead, it will be received as a celebration of the crime that took place on September 11," he said.
Americans on Tuesday marked the 11th anniversary of the September 11, attacks in which nearly thousands were killed when hijacked airliners crashed into the Pentagon and New York's World Trade Center, and another was brought down in Pennsylvania.
'Sorry for the embassy'
The film was made by an Israeli filmmaker, Sam Bacile, who has gone into hiding.
The film was promoted by Morris Sadek, an extreme anti-Muslim Egyptian Christian campaigner who lives in California.
Speaking by phone to the Associated Press from an undisclosed location, writer and director Bacile remained defiant, maintaining that he intended his film to be a provocative political statement.
Bacile, 52, 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.
The two-hour movie, "Innocence of Muslims'', cost $5m to make and was financed with the help of more than 100 Jewish donors, said Bacile.
Sadek said that he had promoted the video on his website and on certain TV stations, which he did not identify.