Investigators are trying to piece together exactly what happened during Tuesday's US consulate attack in the Libyan city of Benghazi.

They are trying to establish whether the assault was planned or spontaneous. Libyan Deputy Interior Minister Wanis al-Sharif has told reporters he believes militants used an anti-US protest as cover for the attack, and may have had help from inside the country's security services.

Here is the timeline of events that US officials believe led to the death of US ambassador Christopher Stevens, his state department colleague Sean Smith and former Navy Seals Tyrone Woods and Glen Doherty.

10pm: Attackers open fire at the consulate, which has a main building and a smaller annex.

10.15pm: The assailants gain entry to the complex and the main building is engulfed in flames.

Many of those trapped inside escape but Ambassador Stevens, Sean Smith and a regional security guard remain.

The security guard manages to escape and returns shortly afterwards with others to try to rescue Mr Stevens and Mr Smith.

They find Mr Smith dead and pulled him from the building, but no sign of Mr Stevens. They are driven from the building by thick black smoke, fire and gunfire.

10.45pm: Security staff try to retake the main building but come under heavy fire and retreat.

11.20pm: A second attempt to retake the main building is successful. Fighting moves to the annex.

Midnight: Fighting at the annex - reported to last about two hours - results in the deaths of two more Americans, later named by US authorities as former Navy Seals whose job was to protect the other staff.

1.15am: Mr Stevens arrives at a nearby hospital - it is not known who took him. A doctor there has told the BBC that he spent an hour trying to revive him, but that Mr Stevens died from smoke inhalation.