US President Barack Obama said the killers of the American ambassador to Libya would be brought to justice, as the United States dispatched two destroyers and a unit of Marines to Libya.
"Make no mistake, we will work with the Libyan government to bring to justice the killers who attacked our people," Obama said.
Tuesday's assault on the Benghazi consulate followed a violent protest at the US embassy in Cairo over an amateurish anti-Islamic film made in the United States and reportedly promoted by a group of US-based Egyptian Copts.
Initial reports said 52-year-old Ambassador Chris Stevens, a fervent supporter of the revolt that overthrew Moamer Kadhafi, and three other Americans were killed by an angry mob as they tried to flee in a car.
But it is now believed that Stevens died from smoke inhalation after becoming trapped in the compound when suspected Islamic militants fired on the building with rocket-propelled grenades and set it ablaze.
US officials are investigating the possibility that the assault was a plot by Al-Qaeda affiliates or sympathizers, using the protests as a diversion to carry out a coordinated revenge attack on the 11th anniversary of 9/11.
US Secretary of State Hillary Clinton said the killings should "shock the consciences" of people of all faiths but vowed that the actions of "a savage and small group" would not make Washington turn its back on Libya.
Obama ordered increased security at US diplomatic missions around the world, amid fears that anti-American protests sparked by the low-budget, privately produced film denigrating the Prophet Mohammed could spread.
There was no immediate conflagration around the Muslim world but CNN showed trouble brewing again on Wednesday night in front of the US embassy in Cairo as anti-US protesters clashed with security officers in riot gear.
New protests against the film were held outside US missions in Morocco, Sudan and Tunisia in addition to those in Egypt. In Tunis, police fired tear gas to disperse a crowd of several hundred.
Obama laid into Mitt Romney after the Republican White House hopeful criticised the initial response from the Cairo embassy as sympathising too much with the perpetrators instead of defending American values.
"Governor Romney seems to have a tendency to shoot first and aim later," Obama said in an interview with CBS News, seeking to paint his opponent in November as a diplomatic liability who is unfit for the Oval Office.
The United States began evacuating all its staff from its mission in Benghazi, flying them first to Germany where a number of wounded -- officials gave conflicting numbers of three and five -- were to be treated.
A detachment of 50 Marines was dispatched to secure the main American embassy in the Libyan capital Tripoli, where staff numbers were being cut to emergency levels.
US diplomatic staff were plunged into mourning, shocked and stunned that one of their own had fallen, the first time a serving ambassador had been killed since Afghan envoy Adolph Dubs died in a 1979 kidnapping.
Under a warm late summer sun, hundreds streamed into the south courtyard at the State Department, where Obama paid a rare visit from the White House to join Clinton in consoling the tight-knit diplomatic community.
Mystery deepened over the identity of the director whose film sparked the protests, with conflicting accounts from backers and promoters but no one owning up to having actually directed it.
US media initially cited someone they dubbed and An American-Israeli calling himself Sam Bacile as saying he made the film on a $5 million budget with the help of 100 Jews, but no record of such a person has been found.
Coptic Christians have been accused of promoting an Arabic adapted version of the English-language film in Egypt, where clips were shown on an Egyptian television station at the weekend, setting off the protests.
The violence in Benghazi was strongly condemned by Libya's General National Congress, which went ahead Wednesday with the election of technocrat Mustafa Abu Shagur as the country's new prime minister in a close vote.
The first task for the new premier will be to bring order to the myriad of militias born out of last year's uprising, as fears grow that unrest could spread and derail democratic progress following the Arab Spring uprisings.
The Benghazi assault came after thousands of Egyptian demonstrators tore down the Stars and Stripes at the US embassy in Cairo and replaced it with a black Islamic flag, similar to one adopted by several militant groups.
Nearly 3,000 demonstrators, most of them hardline Islamist supporters of the Salafist movement, had gathered at the embassy in a protest over the film.
Worryingly for the United States, the first reaction of Mohamed Morsi, elected Egypt's first Islamist president in the wake of the 2011 revolution, was to condemn not the attack on the embassy but the film that provoked it.
"The Egyptian people, both Muslims and Christians, refuse such insults on sanctities," he said in a statement posted on his Facebook page.
The Muslim Brotherhood, the Islamist movement through which Morsi rose to power, has called for protests over the film outside mosques across Egypt after Friday prayers.
In an interview with Telemundo broadcast late Wednesday, Obama was frank about Egypt-US relations after the fall of Hosni Mubarak.
"I don't think that we would consider them an ally, but we don't consider them an enemy. They are a new government that is trying to find its way. They were democratically elected," he said.