(CNN) -- Inside a safe room of the U.S. consulate in Benghazi, Libya, Ambassador Chris Stevens took cover with two other foreign service officers.
Just minutes earlier, a group of heavily armed militants launched an attack on the complex, pelting it with gunfire and rocket-propelled grenades.
The attackers ignited a fire in the building and the safe room was filling with smoke.
Stevens, Foreign Service information management officer Sean Smith and a U.S. regional security officer would soon be forced to leave their temporary refuge from the assault.
Senior administration officials called the conditions inside "awful," describing "incredibly thick smoke and fire."
The officials, while still trying to piece together the details of how the Tuesday night consulate attack unfolded, began Wednesday to give a clearer picture of events.
The violence began around 10 p.m. Tuesday amid a protest by the radical Islamist group Ansar Al-Sharia against a film mocking Islam's prophet.
Four hours later, the consulate was destroyed, its walls blackened by shooting flames. Four Americans, including Stevens and Smith, were dead.
Within 15 minutes of the first gunshots, the attackers were able to enter the main compound of the consulate complex and set it ablaze.
Stevens, Smith and a regional security officer were the only people inside the building at the time.
Photos taken Tuesday night show flames shooting from every orifice of the building as militants wielding weapons walk through the compound.
The heavy, black smoke added to the confusion of the situation and the three diplomatic officers became separated as they evacuated the safe room, the administration officials said.
Meanwhile, American and Libyan security personnel, forced to fend off an attack on the outside and the raging fire within, were grappling with how to handle the increasingly complicated scene, U.S. officials said.
The regional security officer with Stevens and Smith managed to escape the building and returned with others to try to rescue the men. For Smith, the rescue came too late. He had already succumbed to smoke inhalation by the time they arrived. Stevens, in Benghazi on a short trip from the capital Tripoli, was missing, apparently able to make his way out unnoticed in the chaos.
About 45 minutes after the first gunshots rang out, security personnel attempted to retake the main compound, but were repelled by heavy gunfire and retreated to an annex in the complex.
They made a second attempt at 11:20 p.m. -- more than an hour after the attack began -- and successfully regained control of the main building.
But the incident was far from over. The gunbattle continued and the attack moved from the main compound to the complex's annex.
"It was during that time that two additional U.S. personnel were killed and two others were wounded," one of the senior administration officials said.
Finally, around 2:30 a.m., four and a half hours into the attack, U.S. security personnel, assisted by Libyan forces, took back control of the entire consulate complex.
Still unknown at that time, however, was Stevens' whereabouts.
Libyans said bystanders had helped carry an unconscious Stevens to a hospital. However, U.S. officials could not confirm that account.
"We are not clear on the circumstances between the time he got separated from the rest of the group inside the burning building to the time we were notified that he was in a Benghazi hospital," the senior administration official said. "We were not able to see him until his body was returned to us at the airport."
Also unclear Wednesday was the significance of the timing of the attack, which fell on the 11th anniversary of the September 11 attacks on New York and Washington and coincided with a violent protest at the U.S. Embassy in Cairo, Egypt.
State Department officials said the two incidents at the diplomatic missions were not related and said they believe the Benghazi violence was a "clearly planned attack."
"It was not an innocent mob," one senior official said. "The video or 9/11 made a handy excuse and could be fortuitous from their perspective but this was a clearly planned military-type attack."
U.S. President Barack Obama, however, said it was too early to say whether the attack was pre-planned.
As dawn broke Wednesday, the magnitude of the previous night's events were felt by both Americans and Libyans. Charred debris and ash littered the floor of the burned-out consulate. A small American flag lay amid the rubble. And both the governments of the United States and Libya, on this "very, very difficult day," mourned the loss of Stevens, who had helped save Benghazi during last year's revolution.
"He risked his life to stop a tyrant, then gave his life trying to help build a better Libya," U.S. Secretary of State Hillary Clinton said.
CNN's Tom Cohen, Elise Labott and Jill Dougherty contributed to this report.