US president Barack Obama has accused rival Mitt Romney of having a tendency "to shoot first and aim later", after he criticised the White House for its response to violent attacks on diplomatic compounds in Libya and Egypt.

Mr Obama told CBS News that Mr Romney's late night statement on the unfolding drama was premature, and proof of his rival's propensity to lash out even when he does not have his "facts right".

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Listen Duration: 3 minutes 19 seconds 3 m 19 s Manhunt for consulate attackers Download 1.5 MB

"There's a broader lesson to be learned here: Governor Romney seems to have a tendency to shoot first and aim later," Mr Obama said in the interview.

"As president, one of the things I've learned is you can't do that - it's important for you to make sure that the statements that you make are backed up by the facts and that you've thought through the ramifications before you make them."

The US ambassador to Libya, Christopher Stevens, was among four Americans who died when Islamist gunmen attacked the US consulate in Benghazi and a safe house where survivors of the initial assault were taking refuge.

Another attack was mounted on the US embassy in Cairo, where protesters tore down an American flag.

Both attacks are believed to have been motivated by anger over a low-budget film, Innocence of Muslims, which denigrates the Prophet Mohammed.

Loading...

Mr Romney earlier stood by his claim that the Obama administration is more interested in sympathising with perpetrators of the attack on the US embassy in Egypt than defending American values.

He was angry the embassy stood by a statement issued before its walls were breached by protesters, in which it condemned the film, made by a US director, as an attempt to "hurt the religious feelings of Muslims".

Mr Romney accused Mr Obama of weakening America's position in the world by apologising for US actions.

"It's never too early for the United States government to condemn acts on Americans and to defend our values," Mr Romney said in Jacksonville, Florida.

But Mr 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.

"There is a broader lesson to be learned here and Governor Romney seems to have a tendency to shoot first and aim later."

Mr Romney has been criticised before on foreign policy issues, notably when he branded Russia as America's top geopolitical foe and made a series of missteps during a recent trip to Britain, Israel and Poland.

Nicholas Burns, a career diplomat who served several presidents and rose to the number three job in the State Department under Republican George W Bush, said he was distressed by Mr Romney trying to score political points.

"I was, frankly, very disappointed and dismayed to see Governor Romney inject politics into this very difficult situation where our embassies are under attack, where there's been a big misunderstanding in the Middle East, apparently, about an American film, where we're trying to preserve the lives of our diplomats," Burns said on MSNBC.

"This is no time for politics."

Loading...

Criticism from Democratic lawmakers has been swift and severe.

"At a time when we should be standing together against these senseless acts of violence, Mitt Romney offered an atrocious political response that undermines our unity in the face of threats to Americans around the world," Democratic Senator Frank Lautenberg said.

Mr Obama has condemned the attack in Benghazi as "outrageous and shocking" but insists it will not harm relations with Libya's new elected government, which took power in July after rebel forces overthrew Moamar Gaddafi last year.

During an appearance in the White House's Rose Garden, Mr Obama 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," he 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.

A car burns at the US consulate building in Benghazi. ( AFP )

Reuters/AFP