Algerian firemen carry a coffin containing a person killed during the gas facility hostage situation at the morgue in Ain Amenas, Algeria, Monday, Jan. 21, 2013. This recent but undated view made available Monday Jan. 21, 2013, showing the damaged natural gas plant after Islamist militants attacked it and took hostages at Ain Amenas, Algeria. The militants were wearing Algerian army uniforms and were equipped with explosives to blow up the plant, according to Algeria's Prime Minister Abdelmalek Sellal, who said Monday that at least 81 people died in the four-day operation by government forces to liberate the hostages, including 32 Islamist militants. Five foreigners are still reported as missing. Algerian Prime Minister Abdelmalek Sellal answers questions during a press conference held in Algiers, Monday, Jan. 21, 2013. The Islamist militants who attacked a natural gas plant in the Sahara wore Algerian army uniforms, memorized the layout of the vast complex and included two Canadians and a team of explosives experts ready to blow the place sky-high, Algeria's prime minister said Monday. AP Photo/Sidali Djarboub Algerian firemen unload a refrigerated truck with bodies killed during the hostages taking in a gas plant while police officers look on at the morgue in Ain Amenas, Monday, Jan. 21, 2013. ALGIERS, Algeria (AP) - The hostage-taking at a remote Algerian gas plant was carried out by 30 militants from across the northern swath of Africa and two from Canada, authorities said. The militants, who wore military uniforms and knew the layout, included explosives experts who rigged it with bombs and a leader whose final order was to kill all the captives. The operation also had help with inside knowledge - a former driver at the plant, Algeria's prime minister said Monday. In all, 38 workers and 29 militants died, the Algerian prime minister said Monday, offering the government's first detailed account of four days of chaos that ended with a bloody military raid he defended as the only way possible to end the standoff. Five foreigners are still missing. Monday's account offered the first Algerian government narrative of the standoff, from the moment of the attempted bus hijacking on Wednesday to the moment when the attackers prepared Saturday to detonate bombs across the sprawling complex. That's when Algerian special forces moved in for the second and final time. All but one of the dead victims - an Algerian security guard - were foreigners. The dead hostages included seven Japanese workers, six Filipinos, three energy workers each from the U.S. and Britain, two from Romania and one worker from France. He said the Islamists included a former driver at the complex from Niger and that the militants "knew the facility's layout by heart." The vast complex is deep in the Sahara, 800 miles (1,300 miles) south of Algiers, with a network of roads and walkways for the hundreds of workers who keep it running. The attackers wore military uniforms, according to state television, bolstering similar accounts by former hostages that the attackers didn't just shoot their way in. Our attention was drawn by a car. It was at the gate heading toward the production facility. Four attackers stepped out of a car that had flashing lights on top of it," one of the former hostages, Liviu Floria, a 45-year-old mechanic from Romania, told The Associated Press. In addition to the Canadians, the Algerian prime minister said, the militant cell included men from Egypt, Mali, Niger, Mauritania and Tunisia, as well as three Algerians. Officials in Canada could not confirm that any of the attackers were from there. The announcement of the Algerian prime minister is fine, but we need verification. It could be a forged document. We need to confirm," said a Canadian official who was not authorized to speak publicly and requested anonymity. Three Americans died in the attack and seven made it out safely, a U.S. official in Washington said, speaking on condition of anonymity because he was not authorized to speak publicly. The bodies have been recovered, the official said. An earlier report from an Algerian security official that as many as 80 people had died in the assault - including hostages and attackers - appears to have overstated the toll, but the official had cautioned that many bodies discovered during a sweep of the facility were badly disfigured, making it difficult to reach a total. Algeria has not reported any military deaths from four days of confronting the fighters. Algerian authorities are typically reluctant to announce military losses. Repelled by Algerian forces, the militants moved on the main complex, armed with missiles, mortars and bombs for their three explosives experts, said Prime Minister Sellal. They split into two groups, with one infiltrating the complex's living quarters and the other the gas plant. Sellal praised the quick wits of a guard who tripped an alarm that stopped the flow of gas and warned workers of an imminent attack. Floria, the former hostage from Romania, remembered the moment when the power was cut. I ran together with other expats and hid under the desks in my office, locking the door. Attackers went scanning the office facility kicking the doors in. Luckily our door did not break and they went on to other offices," he said. Locals were freed, the attackers made clear from the beginning that only foreigners were a target. Expats were detained. Ultimately, Floria escaped. But not before he heard the two gunshots that silenced a pair of wounded hostages he said he tried to save. The perception of time changes. Seconds become hours. You feel you are losing your mind. I went through this for almost 40 hours," he said. The prime minister said the heavily armed militants had prepared the attack for two months. He said the attackers arrived from northern Mali and had planned to return there with the foreign hostages. In a statement, the Masked Brigade, the group that claimed to have masterminded the takeover, has warned of more such attacks against any country backing military intervention in neighboring Mali, where the French are trying to stop an advance by Islamic extremists. Algeria, despite its government's reservations about the French decision, is allowing French jets to overfly. Col. Thierry Burkhard, the French military spokesman, said he did not know if militants in Mali were aware of the events in Algeria. "However, I'm convinced the terrorist groups in the field have radios, so there's a strong chance that they're not only up to date with what's happening in Algeria but they're listening to everything that Western journalists are saying about the deployment of different forces in the field," he said. The militants' operation was led by an Algerian, Amine Benchenab, who was known to security services and was killed during the assault, Burkhard added. Moktar Belmoktar, who is believed to have orchestrated the attack, said in a statement over the weekend that the Algerian site was chosen after the country opened its airspace. "Their goal was to kidnap foreigners," he said. They wanted to flee to Mali with the foreigners, but once they were surrounded they started killing the first hostages. He said the assault by Algerian special forces on the plant on Saturday that killed the last group of militants and hostages came after the kidnappers attempted to destroy the complex: "They led us into a real labyrinth, in negotiations that became unreasonable." Associated Press reporters Paul Schemm in Rabat, Morocco, Lori Hinnant and Sarah DiLorenzo in Paris, Bradley Klapper in Washington, Rob Gillies in Toronto, and Nicolae Dumitrache and Vadim Ghirda in Pitesti, Romania, contributed to this report.