WASHINGTON (Reuters) - President Barack Obama vowed on Wednesday to bring to justice the killers of the U.S. ambassador and three other diplomats in Libya as he sought to avoid election-year fallout from an attack that cast a spotlight on his administration's handling of "Arab Spring" unrest.
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 U.S.-made anti-Islamic film - quickly reverberated in the U.S. presidential campaign and could have implications for public attitudes toward revolutions across the Arab world.
In an unusually harsh exchange so soon after a national tragedy, Republican candidate Mitt Romney slammed the White House's response to violent attacks in Libya and Egypt, and the president retorted that his campaign rival had a tendency to "shoot first and aim later."
Obama, apparently seeking to seize the initiative in the midst of a close-fought race for re-election in November, pledged in his Rose Garden appearance 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 U.S. embassies around the world, and a Marine anti-terrorist team was dispatched to boost security for U.S. personnel in Libya.
Also, during a regularly scheduled call with Hamid Karzai, president of Afghanistan, Obama discussed ensuring "that the circumstances that led to the violence in Libya and Egypt do not pose a threat to U.S. forces or Afghans," according to the White House.
Ambassador Chris Stevens and three embassy staff were killed late on Tuesday in an attack on the U.S. 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 U.S. 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.
Later on Wednesday, Obama called Smith's wife and Stevens' parents from Air Force One to offer his condolences and to pledge "justice be done when it comes to finding out who is responsible for the attacks that led to their deaths," said White House Press Secretary Jay Carney.
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 U.S. 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.
The embassy on Tuesday had condemned the film about the Prophet Mohammad that angered protesters in Libya and Egypt, and Romney's camp said that amounted to an apology.
Obama, in advance excerpts of a "60 Minutes" television interview released by the White House as the president headed for a campaign event in Nevada, said Romney "didn't have his facts right."
Obama defended the embassy's action while making clear he was not involved in the decision.
"It came from folks on the ground who are potentially in danger," he said in the interview. "And my tendency is to cut folks a little bit of slack when they're in that circumstance rather than try to question their judgment from the comfort of a campaign office."
In the Rose Garden earlier, Obama asserted that he rejected "all efforts to denigrate the religious beliefs of others." But he added, "There is absolutely no justification to this type of senseless violence."
Immediately after his speech, Obama took the unusual step of visiting the State Department to express solidarity with the U.S. diplomatic corps.
He ordered flags to be flown at half-staff at U.S. installations worldwide in honor of those killed in Libya.
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 U.S.-Libyan ties would not suffer.
But she seemed to take note that Americans might resent such an attack on U.S. 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."
Additional reporting by Margaret Chadbourn, Mark Felsenthal, Paul Eckert, Lisa Lambert and Arshad Mohammed and Andy Sullivan aboard Air Force One; editing by Bill Trott, Mohammad Zargham and Cynthia Osterman