Hillary Clinton and Barack Obama condemned the attack on the US consulate Reuters

Barack Obama vowed on Wednesday to hunt down the killers of US ambassador Chris Stevens and three other Americans during an assault on its mission in Benghazi as suspicion grew that the diplomat was the victim of an organised attack by an Islamist group.

"Make no mistake: justice will be done," Obama said at the White House. He described the killing, the first of a US ambassador since 1979, as "outrageous and shocking".

Crucially, though, the president made it clear that the US would work alongside the Libyan government to track down those responsible and would not be turning its back on the Arab spring in Libya or elsewhere in the Middle East.

"This attack will not break the bonds between the United States and Libya," he said.

One witness told the Guardian that a mob fired at least one rocket at the consulate building then stormed it, setting everything ablaze. Stevens is understood to have died from smoke inhalation. Several Libyan security officers were also reported to have been killed in the attack.

The Libyan government expressed deep regret over the attack. The country's interim leader, Mohammed Magarief, apologised, calling the killings "cowardly criminal acts" and part of a campaign "to impede our democratic experiment".

The FBI is being dispatched to Libya to help with the hunt, as well as 50 marines to reinforce the Tripoli embassy. Two US warships were reportedly heading towards the Libyan coast on Wednesday night. US surveillance drones are being redeployed to search for suspects among alleged jihadist camps in eastern Libya.

The state department ordered the evacuation of all non-essential staff from the country.

US secretary of state Hillary Clinton blamed the killings on "a small and savage group". CNN reported a senior US official saying the assault was planned to coincide with the anniversary of the 9/11 attacks on New York and Washington and that those responsible used the protests as cover. The fact that a rocket-propelled grenade was used is cited as evidence.

Congressman Mike Rogers, head of the House intelligence committee, who is usually briefed by the intelligence agencies during a crisis, said details were still fuzzy but it was "a well co-ordinated attack", one in which he said he could see the "signature of al-Qaida" and a link to the 9/11 anniversary.

Rogers, a former FBI agent, told CNN: "It has all the hallmarks of an al-Qaida-style event."

Jay Carney, Obama's White House spokesman, responding to a question from a journalist whether the consulate attack was planned, said: "It's too early for us to make that judgment."

Mohammed el-Kish, a former official with the National Transitional Council, which handed power to an elected parliament last month, blamed the attack on hardline jihadists, as did the Quilliam thinktank in London which tracks jihadist groups.

But other officials cautioned against jumping to conclusions, suggesting that the attack was more likely to have been opportunistic than planned many days in advance.

The killings led to a political row between Obama and his Republican presidential rival Mitt Romney. In what may turn out to be one of the defining moments in the race for the White House, Romney attempted to pin some of the blame on the Obama administration, accusing it of being an apologist for American values.

It was a badly-handled, confused intervention that immediately backfired, with former diplomats, foreign policy analysts and even fellow-Republicans accusing Romney of behaving in an unpresidential manner, making political points with the American corpses barely cold.

Stevens, 52, a career diplomat since 1991, had been a strong backer of the rebels, going into Benghazi at the height of the revolt aboard a cargo ship.

Also killed was another diplomat, Sean Smith, an air force veteran who was based in the Hague but was on temporary transfer to Libya. The other two Americans were security staff.

A senior Obama administration official said three staff were wounded in addition to the four killed. The official ran through the timeline, saying the attackers opened fire about 10pm Libyan time and within 15 minutes they had gained access to the compound shot. They attacked the main building which held three staff, Stevens, Smith and a regional security officer and which caught fire.

"They became separated from each other due to the heavy, dark smoke while they were trying to evacuate the burning building. The regional security officer made it outside, and then he and other security personnel returned into the burning building in an attempt to rescue Chris and Sean.

"At that time, they found Sean. He was already dead, and they pulled him from the building. They were unable, however, to locate Chris before they were driven from the building due to the heavy fire and smoke and the continuing small arms fire."

Exchanges of gunfire continued for a further four hours until Libyan security forces helped the US gain control. Stevens body was found and taken to a hospital in Benghazi.

The attack in Benghazi came after a protest at the US embassy in Cairo on Tuesday afternoon over an American-produced amateur film denigrating Muslims. This was ostensibly the motive behind the protests in Benghazi too.

It was supposedly made by a Californian real estate developer called Sam Bacile, and both the Associated Press and the Wall St Journal had quoted somebody using that name saying that he was in hiding.

But by Wednesday evening, there were signs that Bacile did not exist and it was unclear who was behind the production. Cast members said they had been duped into making it and that anti-Islamic dialogue had been dubbed on later.

Obama, in an apparent swipe at the film, said the US was a nation that respected all faiths and "we reject all efforts to denigrate the religious beliefs of others". In spite of that, he added: "There is no justification for this senseless violence. None. The world must stand together to unequivocally reject these brutal acts."

The ambassador's killing follows an attack in June on the UK ambassador to Libya, Dominic Asquith. Two British bodyguards were injured after a rocket was fired at Asquith's convoy in Benghazi. There have been similar attacks on the Red Cross and the UN premises. The UK foreign secretary, William Hague, condemned the attack as "brutal and senseless".

According to the Libya Herald, which cited local witnesses, the killers included members of the hardline Islamist group Ansar al-Sharia. But a spokesman, Hani al-Mansouri, told the Guardian the allegation was false.

Noman Benotman, a former Libyan jihadi who now runs the Quilliam thinktank in London, said he had information it was a terrorist attack that was planned to avenge Abu Yahya al-Libi, al-Qaida's Libyan second-in-command, who was killed in a US drone strike a few months ago.

Egypt's president, Mohammed Morsi, who used to lead the country's Muslim Brotherhood, was criticised for not speaking out to condemn the Cairo incident. But he asked the Egyptian embassy in Washington to take legal action in the US against the makers of a film.

The Brotherhood called for nationwide protests on Friday outside all main mosques. "The president has to balance between his domestic alliances with ultraconservative Islamists and Egypt's relations with the US on the foreign affairs front," said analyst Khalil a-Anani.

As anger over the film spread across the Muslim world, the Afghan government gave orders for YouTube to be closed to the public until the offending film was removed, though the site was still visible to internet users in Kabul.

• Additional reporting by Luke Harding, Chris Stephen and Sarah Sirgany.