The gunmen, dressed in fatigues and wearing turbans, stormed in well before dawn aboard pickup trucks, announcing their arrival with a burst of gunfire.
Dozens of employees were eating breakfast at the time before heading off to the vast network of tubes and silos of the Ain Amenas gas field, where hundreds of Algerians and foreigners work to extract natural gas from the arid sands of the Sahara.
"God is great," the gunmen cried as they arrived.
It was the beginning of a terrifying ordeal, one in which foreign hostages would come under fire from both the gunmen holding them and the Algerian government soldiers trying to free them. For many of the captives, it is an ordeal that has yet to end.
Some hostages were forced to wear explosives on their bodies. Others hid under beds and on rooftops, praying to survive but expecting death. One was shot in the back while his fellow captives looked on. Left by their captors with their cellphones, some phoned home with terrifying accounts of the horrors unfolding all around.
These were among the chilling tales recounted Friday by some of the hundreds of workers who managed to escape the national gas field on the eastern edge of Algeria that had been stormed by Islamist militants two days before.
The gunmen, fighters with a group called Al Mulathameen, said they were acting to avenge the French intervention in nearby Mali, Algerian officials said. But there were indications that the attack had been planned long before the French military began its offensive to recapture the northern half of that country from Islamist insurgents.
The attackers appeared to know the site well, even the fact that disgruntled Algerian catering workers were planning a strike.
"We know you're oppressed, we've come here so that you can have your rights," the militants told Algerians at the facility, according to one Algerian former hostage. Another hostage said the fighters had asked about the plans for a strike.
"The terrorists were covered with explosives, and they had detonators," said a senior Algerian government official briefed on the crisis. He said the situation remained a standoff Friday, with "a few terrorists holding a few hostages."
Former captives said several of the fighters appeared to be foreign, with non-Algerian accents. One Algerian worker said that some of them may have been Libyan and Syrian and that one might have been French. Another gunman who spoke impeccable English was assigned to speak to the many foreigners.
When the Algerian military eventually intervened, the situation grew even more chaotic. According to one witness, Algerian helicopters attacked several jeeps that were carrying hostages.
The fate of at least some of those hostages remains unknown, as the Algerian state news agency reported that 12 Algerian and foreign workers had been killed since the start of the military operation and that dozens remained unaccounted for.
The U.S. State Department acknowledged late Friday that an American, Frederick Buttaccio, had died, McClatchy Newspapers reported.
From the start, it was clear that the gunmen only wished to harm foreigners. Algerian workers, along with other Muslims who could prove their faith by reciting from the Quran, were herded into one area, workers said.
"They told us, 'We are your brothers. You have telephones: call your families to reassure them,' " said Moussa, an Algerian worker who asked to be identified only by his first name.
Algerian women in the group of hostages were released right away Wednesday morning, Moussa said, but the militants initially declined to release the Algerian men, saying it was for their own good.
"We're afraid that if we free you, the army will shoot at you," he quoted them as saying.
Foreigners, meanwhile, were taken away, their hands bound with rubber, both Algerian witnesses said.
Some of the employees resisted. Several Filipino workers who had refused to leave their rooms were beaten, Moussa said. At one point, the fighters shot a European as he tried to flee, he said. The other Algerian described seeing a middle-aged European man, perhaps a security official, shot in the back in the cafeteria, where the lights had been switched off.
He believed the man had died.
Before being captured, Stephen McFaul, 36, an electrical engineer from Belfast, barricaded himself in a room with a colleague at the first sound of gunfire, quietly using his cellphone to assure his family that he was all right.
"I joked that I was from Northern Ireland and that I had been through better riots," he told the colleague, according to John Morrissey, a representative for his family in Belfast who was responding to reporters for media organizations around the world.
McFaul, who had been sent to work in Algeria only three weeks ago, was seized a few hours later, Morrissey said, and ultimately placed in the last jeep of a five-jeep convoy that came under heavy air attack from Algerian forces.
The first four jeeps were destroyed, and when McFaul's vehicle veered off the road, he and a fellow worker managed to climb out of the back window, which had been broken. Their hands had been tied, their mouths taped and they had been forced to wear vests loaded with explosives, Morrissey said.
The two made a run for it, reaching the security forces, who disarmed the explosives.
The spokesman said McFaul was "bright and together and nervously excited" about returning home.
Other foreigners like Alexandre Berceaux, a French employee of a catering company working at the site, hid themselves as best they could.
"I stayed hidden for nearly 40 hours in my bedroom," Berceaux told Europe 1 Radio. "I was under the bed, and I put boards everywhere just in case. I had food, water; I didn't know how long I would be there."
He said he was certain he would be killed.
"When the Algerian soldiers, whom I thank, came to get me, I didn't even know it was over," he said. The soldiers came with his colleagues, he said, "otherwise I would never have opened the door."
Berceaux said Algerian soldiers found some British hostages hiding on the roof and were still searching the site for others when he was escorted to a nearby military base, from which he expected to be transferred to France. Others might still be hidden, he said.