article: The assault had earlier been thought to have been a spontaneous reaction to protests over an anti-Islamic film. US President Barack Obama has called the presidents of Egypt and Libya to urge cooperation over security for diplomatic staff. There have been further clashes outside the US embassy in Cairo overnight. Thousands of people gathered outside the building in the Egyptian capital, chanting and starting fires. Police and troops fired tear gas to break up the crowds, some of whom were seen carrying petrol bombs. On Wednesday, demonstrators in Cairo angry at the film - Innocence of Muslims - had breached the walls of the US embassy and torn down the flag. President Barack Obama has vowed to bring those behind the attack to justice, but said the US would not "break bonds" with the new Libyan government. The White House says Mr Obama spoke to Libyan President Mohamed Magarief on Wednesday evening and agreed the two countries should work together to identify the attackers. In a further call to Egypt, President Mohammed Morsi promised to ensure the safety of American staff in the country, the White House said. Security has been tightened at US embassies across the world. A marine anti-terrorism team is being deployed to Libya to bolster security there, a US defence source told reporters in Washington. The US says it is also sending two destroyers to the coast of Libya as a precautionary measure. Armed men stormed the consulate in the city of Benghazi on Tuesday night. It is believed Ambassador J Christopher Stevens died of smoke inhalation. Three other Americans and up to 10 Libyans also died in the attack. Officials have now said the attack was complex and professional, and reports suggest the perpetrators may have had links to jihadist groups. By Mark MardellNorth America editor A senior US official quoted by AFP news agency said the Benghazi attackers appeared to have used the demonstrations as a pretext to staging an assault. "This was a complex attack," he told the news agency. "They seemed to have used this [protest] as an opportunity." US officials told Reuters news agency there were suspicions that a militia known as the Ansar al-Sharia brigade was responsible, although the group has denied the claim. They said there were also reports that al-Qaeda's north Africa-based affiliate, al-Qaeda in the Islamic Maghreb, may have been involved, the news agency reports. The consulate compound began taking heavy fire at about 22:00 local time (20:00 GMT) on Tuesday night, and the main building was in flames soon afterwards. Libyan and US security forces tried to retake the compound several times, US officials said, but only succeeded early on Wednesday. One of the Americans killed was Sean Smith, a state department employee. The other victims have not yet been identified. Seventeen-year-old Hamam, who took part in the attack, told Reuters that Ansar al-Sharia cars had arrived at the start of the protest but later left. By PJ CrowleyFormer US Assistant Secretary of State Viewpoint: Libya deaths no surprise "The protesters were running around the compound just looking
summary: The US is investigating whether the attack in Libya that killed the US ambassador and several other people was planned in advance, officials say.