Officials in this secretive country said they had discovered cases before when Islamist rebels succeeded in having fellow militants employed by international energy companies. One told Reuters it was possible insiders had cooperated at In Amenas.
Locally hired workers who escaped told Reuters of seeing the gunmen moving around the sprawling facility with confidence, apparently familiar with its layout and well prepared.
The militants said they launched the raid to halt French military intervention in neighbouring Mali, which began a week ago, however the link is not yet clear. Several European and U.S. officials said the assault seems too elaborate to have been planned in such a short time.
It is possible the attack would have happened anyway, or that the French military operation provided a trigger to carry out an attack based on preparations made earlier.
Much may never become clear. The raid was carried out in a region closed to outsiders within a country whose government is unused to sharing sensitive information with the public.
First word of trouble came crackling over a walkie-talkie to the communications room at In Amenas, where a 27-year-old radio operator called Azedine logged a contact with a bus driver who, at 5:45 a.m. left to take some foreigners to the airstrip at the town of In Amenas, some 30 miles away.
"Moments after the bus left, I heard shooting, a lot of shooting, and then nothing," Azedine told Reuters on Friday.
Two people, one British, one Algerian were killed on two buses heading for the airport. It is not clear whether that incident was part of the plan that secured the militants access to the compound. Almost immediately after the bus skirmish, they were inside, in at least three vehicles.
The first Briton to die was identified as a Gulf war veteran who had been in the French Foreign Legion and was working for a security company.
People who have worked at the site, which sits with its back to cliffs in the dunes, say there was normally an overnight curfew, leaving it unclear how the gunmen were able to get so close before being challenged.
Their initial approach may have been well off the main roads.
Freed hostages spoke of an alarm being raised, of frightened people staying in their offices or hiding in their dormitories. Azedine saw a gunman put on the ID badge of a French supervisor who had been shot dead.
A French catering firm employee spent 40 hours cowering alone under his bed, terrified he would be killed.
Alexandre Berceaux said he had survived by staying in his room away from other foreigners, hidden behind a barricade of wooden planks and having Algerian colleagues sneak him food and water.
Pulled to safety on Thursday evening with other foreigners by Algerian soldiers who stormed the site, Berceaux had been so scared of being discovered that he only opened his bedroom door if the person knocking gave a secret password.
"I was completely isolated ... I was afraid. I could see myself already ending up in a wooden box," Berceaux said in a radio interview.
Rapidly the area was surrounded by heavily armed Algerian troops, with tanks, armoured vehicles and helicopter gunships from a nearby military base.
The government in Algiers said it would not negotiate.
People who know the site, operated by Britain's BP and Statoil of Norway along with Algeria's state energy company, Sonatrach, said a barracks housing several hundred soldiers lies along the three km (two miles) of road separating the accommodation compound from the industrial plant.
A former senior Algerian government official said guards appeared to have been caught napping: "They have all kinds of equipment, detailed surveillance cameras," he said. "They were caught maybe at the right time, at five in the morning."
But he also acknowledged the militants may have had help among the local workforce: "Out of 700 Algerians, I am sure they will find a couple who will cooperate. It always happens."
Militant leaders like Taher Ben Cheneb, said by officials to have been one of the commanders of the operation and to have been killed on Thursday, have stoked resentment among southerners at the way foreigners and northerners dominate the better paid jobs in the oil fields.
Ben Cheneb, described as a high school maths teacher in his 50s, led the Movement of the Islamic Youth in the South.
Security expert Rahmani said he joined forces for this operation with followers of Mokhtar Belmokhtar, a veteran of Afghan wars and a leading figure in Al Qaeda in the Islamic Maghreb (AQIM) who recently formed a new group named Mulathameen.
Belmokhtar, the overall commander but not present during the attack, claimed responsibility on behalf of al Qaeda for a raid he called a "blessed operation".
The two men had cooperated before, Rahmani said, notably in damaging an airliner in 2007 at Djanet, further to the south.
While Ben Cheneb's group appeared to have moved on In Amenas from a base inside Algeria, Rahmani said, Belmokhtar's men, led by Abu El Bara, appeared to have come in from Libya. Ben Cheneb, however, was based in Libya and had married a Libyan woman only two months ago, according to El Khabar.
The group's field commander was a veteran fighter from Niger called Abdul Rahman al-Nigeri, Mauritanian news agencies reported. He led his men into the gas plant, where he is believed to have been killed, while another of the group's leaders, Abu al-Bara'a al-Jaza'iri, was killed at the residential complex.
Noting the one-eyed Belmokhtar's reputation as a cigarette smuggler as well as a holy warrior - locals call him the "Mister Marlboro" - Rahmani added: "They use the same back roads as the smugglers. You need a perfect knowledge of the Sahara to do it.They can use the same wells as the smugglers, the same fuel dumps hidden in the desert."
Canadian diplomat Robert Fowler, who was captured by Belmokhtar in Niger in 2008 and released after four months, nicknamed him "Jack" so as to be able to discuss him privately with fellow captives.
Belmokhtar in turn referred to his prisoners as apostates and infidels.
More than a decade after Algeria's civil war killed some 200,000 people, Islamist fighters roam the sandy wastes of Africa's biggest country, mixing smuggling and kidnapping for ransom with opposition to the political establishment that has ruled in Algiers since French colonists left half a century ago.
These groups have been energised by the return of heavily armed ethnic Tuaregs and others from Libya, where they fought as mercenaries for Muammar Gaddafi until his overthrow in 2011. The new Libyan authorities are struggling to control their own deep south and it provides a launchpad for raids across the frontier.
While security forces seek to impose control, the tracts of sand are vast, borders among the half dozen countries around the desert are unmarked, and the big money that can be made from illicit trade or kidnapping tourists and Western engineers can be used to buy favours from ill-paid officials.
Al Qaeda says it is fighting for a Muslim caliphate that transcends artificial borders in the Maghreb set by colonial powers.
Once inside the facility, militants, including bearded, ragged fighters and others in more urban dress, herded groups of Westerners together. Hundreds of Algerians were guarded more loosely. One Algerian worker told Reuters the gunmen said they were only interested in killing "Christians and infidels".
Several former hostages described the attackers, from their accents, as appearing to be Libyan or Egyptian as well as Algerian. Officials said many of the dead gunmen were foreign.
Algeria told Western governments, which voiced dismay at the storming of the facility on Thursday, that troops moved in only because guerrillas were trying to leave with hostages, possibly hoping to reach the Malian border.