The US ambassador to Libya and three guards have been killed by protesters angry over a film that ridiculed Islam's Prophet Mohammed.
Ambassador Chris Stevens, 52, died as he went to the Benghazi consulate to try to evacuate staff as the building came under attack by a mob firing machine-guns and rocket-propelled grenades.
The attack came hours after Egyptian protesters climbed the walls of the US Embassy in Cairo, pulling down the American flag and temporarily replacing it with a black Islamic banner.
The film which caused the unrest was produced by Californian property developer Sam Bacile who has now gone into hiding.
He claimed to be both American and Israeli, although Israel said it had no record of him as a citizen. The film was being promoted by an extreme anti-Muslim Egyptian Christian campaigner in the United States. Excerpts from it dubbed into Arabic were posted on YouTube. The video depicts Mohammed as a fraud, a womaniser and a madman in an overtly ridiculing way, showing him having sex and calling for massacres.
Mr Bacile said he had not expected it to cause such a furious reaction. But he remained defiant, saying Islam was a cancer and that he intended his film to be a provocative political statement condemning the religion. He said it exposed Islam's flaws to the world. "Islam is a cancer, period," he said.
The assaults - the first on US diplomatic facilities in either country - underscored the lawlessness that has taken hold in both Egypt and Libya after revolutions overthrew their autocratic secular regimes and upended the tightly controlled police state in both countries. Islamists, who were long repressed under the previous regimes, have emerged as a powerful force but new governments in both nations are struggling to achieve stability.
Mr Stevens was a career diplomat who spoke Arabic and French and had already served two tours in Libya, including running the office in Benghazi during the revolt against Gaddafi. He was confirmed as ambassador to Libya by the Senate earlier this year. The three Americans who died with him were his security guards.
President Barack Obama immediately ordered increased security to protect American diplomatic personnel around world. Libya's interim president, Mohammed el-Megarif, apologised to the United States for the attack, which he described as "cowardly."
Five other US ambassadors have been killed in the line of duty, the last being Adolph Dubs in Afghanistan in 1979.