Discuss as:

The attack on the Libyan consulate, as it happened

The deaths of four Americans, including the U.S. ambassador, are a grim reminder of the dangers that lurk in Libya. NBC's Steve Handelsman reports.

NBC News compiled this reconstruction of the assault on the U.S. Consulate in Benghazi, Libya, after a briefing from senior U.S. officials, who asked not to be identified and cautioned that it was imprecise because it was based on preliminary field reports:

Follow M. Alex Johnson on Twitter and Facebook.

10 p.m. Tuesday (4 p.m. ET): The compound, a temporary facility with a nearby annex, begins taking fire.

10:15-10:45 p.m.: The attackers enter the compound and begin firing into the main building, setting it on fire. Mission security and Libyan guards respond. Ambassador Christopher Stevens, information management officer Sean Smith and a regional security officer are the only people in the main building at the time. At some point, they become separated because of the heavy smoke. The security officer makes it out safely.

US won't rule out Islamist link in killing of US ambassador to Libya

The security officer and other security personnel return to the burning building to rescue Stevens and Smith. Smith is already dead, and the rescuers pull his body from the building. They can't find Stevens before they are driven from the building by the fire and smoke. 

10:45 p.m.: U.S. security personnel try to take back the main building, but they come under heavy fire and return to the mission annex, where 25 to 30 people are holed up.

11:20 p.m.: U.S. and Libyan security personnel again try to take back the main building, this time successfully. They evacuate the rest of the personnel. 

Tuesday night: Defense Secretary Leon Panetta is briefed.

12 midnight: The mission annex comes under fire, which continues for about two hours. Two Americans are killed, and two others are wounded. 

3 a.m. Wednesday (9 p.m. ET Tuesday): The fighting is over, and U.S. and Libyan security forces regain control of the compound.

Romney slams Obama over attacks on US officials in Libya, Egypt

Aftermath: The body of Stevens, who was taken to a Benghazi hospital at an unknown time, is returned to U.S. personnel at the Benghazi airport. A plane arrives from Tripoli to evacuate all personnel back to the capital, including the three wounded and the remains of the four people who were killed. All diplomatic posts are ordered to review their security.

US Ambassador Chris Stevens was 'courageous and exemplary,' Obama says

More world stories from NBC News:

Follow World News from NBCNews.com on Twitter and Facebook