President Barack Obama has called the presidents of Libya and Egypt and urged them to continue working with the US to ensure the safety of diplomatic personnel, the White House said.
Mr Obama thanked Libyan president Mohamed Magariaf for his condolences over the deaths of US ambassador Chris Stevens and three other State Department officers during an assault on the US consulate in Benghazi on Tuesday.
The White House said the two leaders agreed to work together to bring the attackers to justice.
In a second call, Egyptian president Mohammed Morsi promised Egypt “would honour its obligation to ensure the safety of American personnel”, the White House said.
Mr Obama told Mr Morsi that, while “he rejects efforts to denigrate Islam ... there is never any justification for violence against innocents”.
Meanwhile Mr Obama traded tough words with Republican presidential rival Mitt Romney over the handling of foreign attacks on US diplomatic missions in the Middle East.
Mr Romney accused the Obama administration of showing weakness in the wake of the deadly attack in Libya, but the Republican was widely criticised for speaking too soon and erroneously about the events in Libya and Egypt.
Mr Obama made a sombre statement condemning the attacks and later told CBS News that the episode shows Mr Romney has “a tendency to shoot first and aim later”.