US President Barack Obama has vowed to bring to justice the killers of the US ambassador to Libya during protests against a film that mocks Islam.
But he told reporters that the attack on the American consulate in Benghazi would not break the bonds between the US and the new Libyan government.
Mitt Romney, Mr Obama's political foe, criticised his handling of the crisis.
Ambassador J Christopher Stevens reportedly died of smoke inhalation after a crowd stormed the consulate.
Three other Americans were also killed and the consulate set ablaze.
Rocket-propelled grenades were reportedly fired during the assault on Tuesday night.
Charred vehicles could be seen parked near the damaged buildings on Wednesday.
A US marine anti-terrorism team is being sent to Libya to bolster security after the attack, a US defence source told reporters in Washington.
Protesters against the film attacked the US embassy in Cairo on Tuesday night.
In other developments on Wednesday:
- Nigeria placed its police force on red alert to guard against attacks related to the controversial film
- The US embassy in Algiers warned Americans in Algeria to avoid non-essential travel amid calls for protests on social media
- Tunisian police fired tear gas and rubber bullets into the air to disperse a protest by several hundred people near the US embassy in the Tunisian capital, Tunis, as they chanted slogans including "Obama, Obama, we are here for the triumph of Islam", Reuters reports
- Demonstrations were reported outside the US embassy in the Sudanese capital Khartoum and the US consulate in Casablanca, Morocco, as well as outside the UN offices in the Gaza Strip
- The Afghan government ordered a block on Youtube until the offending film was removed but the site was still visible to internet users in Kabul
Speaking in the Rose Garden at the White House, President Obama told reporters: "Make no mistake. Justice will be done."
He said he condemned "in the strongest possible terms the outrageous and shocking" attack.
"It is especially tragic that Chris Stevens died in Benghazi because it is a city that he helped to save," he added, praising the dead ambassador for his work in Libya after the overthrow of the late Col Muammar Gaddafi.
Reports say a militia known as the Ansar al-Sharia brigade was involved in the attack, but the group has denied the claim, the BBC's Rana Jawad in Tripoli says.
Ambassador Stevens and his staff went to the consulate in an attempt to evacuate the site after it was attacked, the Associated Press news agency said.
The building apparently came under attack by a crowd armed with guns and rocket-propelled grenades.
The Libyan doctor who treated Mr Stevens in hospital said he died of severe asphyxiation, apparently from smoke inhalation, with no other injuries
Dr Ziad Abu Zeid, who told AP he tried for 90 minutes to revive him, said Mr Stevens was the only American brought into the Benghazi Medical Centre and initially nobody realised he was the ambassador.
Libya's interim leader, Mohammed Magarief, apologised to the US over the killings, which he called "cowardly criminal acts".
Libya's deputy envoy to the UN, Ibrahim Dabashi, told the UN Security Council that his government was carrying out an investigation but he admitted it did not control all of Libya's territory.
"We cannot understand how this group, or these persons, could have eliminated such a wonderful person," he said.
Both UN Secretary-General Ban Ki-moon and the UN Security Council condemned the attack.
Mr Romney, Mr Obama's Republican challenger in this November's presidential election, said the Obama administration had appeared to "sympathise with those who waged the attacks" in Benghazi and Cairo.
Mr Obama's team, he said, had sent "mixed signals to the world" in the face of violence.
UK Prime Minister David Cameron said he had sent condolences to President Obama and that he expected the new Libyan authorities to "do all in their power... to bring the killers to justice".
Our correspondent says many people in Libya are still armed following the conflict that overthrew Gaddafi.
Analysts say the attack will raise serious new concerns about stability in the country and the ability of the new Libyan administration to maintain security.
In June, two British bodyguards were injured in an attack in Benghazi on a convoy carrying the British ambassador to Libya. Red Cross and UN staff also came under attack this year.
Correspondents say the film at the heart of the row, which appeared on Youtube translated into Arabic, is highly provocative and insulting to Muslims.
An Islamic tenet bans the portrayal of the Prophet Muhammad.
Cartoons featuring the founder of Islam sparked violent unrest among Muslims in 2005 when they were published by a Danish newspaper.