You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
Standing in the White House Rose Garden, Obama condemned the attack in Benghazi as "outrageous and shocking" but insisted it would not harm relations with Libya's new elected government, which took power in July after rebel forces backed by NATO air power overthrew Muammar Gaddafi Last year.
The targeting of American diplomats - in militant violence sparked by a US-made anti-Islamic film - quickly reverberated in the US presidential campaign and could have implications for public attitudes toward revolutions across the Arab world.
Obama, apparently seeking to seize the initiative in the midst of a close-fought race for re-election in November, pledged to work with the Libyan government to "see that justice is done for this terrible act."
"And make no mistake: justice will be done," Obama said, with Secretary of State Hillary Clinton at his side.
He ordered increased security at US embassies around the world, and a Marine anti-terrorist team was dispatched to boost security for US personnel in Libya.
Ambassador Chris Stevens and three embassy staff were killed late on Tuesday in an attack on the US consulate and a safe house refuge in the eastern city of Benghazi, stormed by gunmen blaming America for a film they said insulted the Prophet Mohammad.
Another assault was mounted on the US embassy in Cairo.
Stevens, 52, was one of the first American officials on the ground in Benghazi after the city became the cradle of the revolt last year against Gaddafi's more than four-decade rule. The 21-year veteran of the foreign service was named ambassador in May.
Sean Smith, a foreign service information management officer, was identified as one of the diplomats killed. The names of the two others were withheld while the government notified their families.
LIBYA POLICY, CAMPAIGN IMPACT
Obama had hailed Libya's election in July as a milestone in its post-Gaddafi democratic transition and pledged that the United States would act as a partner even as he cautioned that there would still be difficult challenges ahead.
In the series of Arab Spring uprisings that shook the Middle East last year, Obama opted for a cautious strategy that steered clear of a dominant role for the US military and drew criticism from Republican opponents at home for what was described as "leading from behind."
Before the full death toll and details of the Libya attack were known, Obama's Republican presidential challenger, Mitt Romney, criticized the Obama administration's initial response and he stood by his position on Wednesday.
"It's disgraceful that the Obama administration's first response was not to condemn attacks on our diplomatic missions, but to sympathize with those who waged the attacks," Romney told reporters in Florida. He has accused Obama of a failure of world leadership and of not upholding American values.
Obama campaign spokesman Ben LaBolt criticized Romney for making a "political attack" at a time of national tragedy, and the president then reiterated condemnation of insults to the beliefs of others.
"We reject all efforts to denigrate the religious beliefs of others," Obama said. "But there is absolutely no justification to this type of senseless violence."
Immediately after his speech, Obama, who was due to leave later in the day on a campaign trip to Nevada, took the unusual step of visiting the State Department to express solidarity with the US diplomatic corps.
He ordered flags to be flown at half-staff at US installations worldwide in honor of those killed in Libya. The giant flag flying over the White House was lowered on Wednesday afternoon.
The Libya crisis has come at a time when the spotlight was already on the Middle East amid escalating tensions between Obama and Israeli Prime Minister Benjamin Netanyahu over how to deal with Iran's nuclear program.
Clinton said the Benghazi attack was the work of a "small and savage group" and that US-Libyan ties would not suffer.
But she seemed to take note that Americans might resent such an attack on US personnel in a North African country they helped to bring out from under long authoritarian rule.
"I ask myself, how could this happen? How could this happen in a country we helped liberate, in a city we helped save from destruction?" Clinton said. "This question reflects just how complicated and, at times, how confounding the world can be."