(CNN) -- At least 37 hostages died in the terrorist seizure of a natural gas facility in eastern Algeria and the subsequent special forces assaults on it, the country's prime minister said Monday.
Five other hostages are missing from the In Amenas complex and could be dead, Prime Minister Abdul Malek Sallal said.
Before Sallal's statement, officials from other countries and companies that employed foreign workers at the sprawling plant had confirmed 29 hostage deaths.
Seven of the 37 confirmed dead haven't been identified yet, according to the prime minister. Those who have been identified include seven Japanese, six Filipinos, three Americans, three Britons and one Algerian, officials from those countries said.
Some 29 militants also died, while three were captured, Sallal said, according to the state-run Algerian Press Service.
The standoff ended Saturday, after four days, when Algerian special forces stormed the complex for the second time. The government said it did so because the militants were planning to blow up the installation and flee to neighboring Mali with hostages.
"If it exploded, it could have killed and destroyed anything within 5 kilometers or further," Sallal said.
Militant says Mali unrest spurred assault; others say it followed ample planning
The crisis began Wednesday when Islamist extremists in pickup trucks struck the natural gas complex some 50 kilometers (30 miles) west of the Libyan border, gathered the Westerners who worked there into a group and tied them up.
After taking over, the well-armed militants planted explosives throughout the complex, Sallal said. They came from eight countries: Algeria, Tunisia, Egypt, Mali, Niger, Canada and Mauritania.
Algeria's military talked with the militants, but their demands that prisoners in the North African nation be released were deemed unreasonable, according to the prime minister. The country's special forces waged the assaults to free the hostages and were backed by the Algerian Air Force.
At one point, the militants tried to flee the compound in vehicles that carried explosives and three or four hostages as human shields, Sallal said. At least two of the vehicles flipped and exploded during the attempt, he said.
Sallal said the terrorists had entered the country from northern Mali, where Malian and French authorities are battling Islamist rebels.
One-eyed veteran Islamist fighter Moktar Belmoktar has claimed responsibility for the hostage-taking on behalf of his al Qaeda-linked group, according to Mauritania's Sahara Media news agency.
Belmokhtar -- who was among 12 defendants, five like him still on the run, who were the subject of an Algerian court hearing Monday related to their terrorist involvement -- said the attack was in retaliation for Algeria allowing France to use its airspace to battle Islamist militants in Mali.
But regional analysts believe the operation was too sophisticated to have been planned so quickly, and Sallal said the hostage scheme had been hatched over months.
Algerian minister says gas plant will restart, foreign workers will return
The targeted gas facility is run by Algeria's state oil company, in cooperation with foreign firms such as Norway's Statoil and Britain's BP. Some 790 people worked there, including 134 foreign workers, Algeria's prime minister said.
British Prime Minister David Cameron said Monday the effort to evacuate workers is complete and that U.K. officials are now focused on bringing the bodies of slain British hostages back home.
Cameron praised Algerian forces for their work in ending the crisis, despite concerns from some nations earlier that the Algerians had unnecessarily put hostages at greater risk.
"This would have been a most-demanding task for security forces anywhere in the world, and we should acknowledge the resolve shown by the Algerians in undertaking it," the British leader said. "The responsibility for these deaths lies squarely with the terrorists."
Such Islamist militant activity is not new to Africa, including recent violence in Mali and Somalia.
Algeria's status as Africa's largest natural gas producer and a major supplier of the product to Europe heightens its importance to those who want to invest there. That interest is coupled with pressure to make sure foreign nationals, and their business ventures, are safe.
Energy and Mining Minister Youcef Yousfi, who a day earlier insisted Algeria can keep its gas facilities secure without foreign forces' help, said he believes the targeted gas facility will be back running "in the shortest possible time" and that foreign workers will soon return. Several foreign companies, including Statoil and BP, evacuated their workers from Algeria after the incident.
"I don't think that these workers have left definitively Algeria," Yousfi told reporters, according to the Algerian Press Service. "Maybe some left ... to reassure their families, but I want to ensure that no company or no worker permanently left the country."
Nations mourn dead, try to account for others
Here is a breakdown on the status of hostages from around the world who were involved in the crisis:
Colombia's president said one of its citizens is presumed dead.
No known French hostages are unaccounted for, the defense ministry said.
A man identified as Yann Desjeux died after telling French newspaper Sud Ouest that he and 34 other hostages were treated well. It was unclear what led to his death.
Japanese Vice Foreign Minister Minoru Kiuchi and officials from JGC, a Yokohama-based engineering firm, saw and identified the bodies of seven Japanese citizens killed in the crisis, Chief Cabinet Secretary Yoshihide Suga announced late Monday.
Three Japanese remain unaccounted for, according to Suga.
Three hostages were on their way back home, state media reported. There is a "worrying possibility" that another is dead while a fifth is unaccounted for, the agency said.
Five Norwegians are missing, while eight are safe, according to Norwegian Prime Minister Jens Stoltenberg.
Six Filipinos are confirmed dead and four are missing, the nation's foreign affairs ministry said. In addition, 16 Filipinos are alive and accounted for, according to a ministry spokesman.
One Romanian lost his life while four others were freed, the country's foreign ministry said.
Three British citizens were killed, the Foreign Office said Sunday. Three other British nationals and a UK resident are also "believed dead," according to British officials. The Foreign Office confirmed the name of one slain hostage, Garry Barlow, in a statement Monday.
"Garry was a loving, devoted family man, he loved life and lived it to the full. He was very much loved by myself, his sons, mother and sister and the rest of his family and friends and will be greatly missed," the Foreign Office quoted his wife, Lorraine, as saying.
Twenty-two other Britons who were taken hostage have safely returned home.
U.S. State Department spokesman Victoria Nuland on Monday said three Americans had been killed and identified them as Victor Lynn Lovelady, Gordon Lee Rowan and Frederick Buttaccio, who had been previously identified.
Seven U.S. citizens survived the crisis, added Nuland, who declined to comment further citing privacy considerations.
Erin Lovelady described her father Victor, of Nederland, Texas, as a laid-back, understanding and loving man.
"I want people to understand how wonderful my dad was, and how great a dad he was, and how much he's going to be missed by me and my mother and my brother," Erin Lovelady told CNN affiliate KFDM, describing herself as "daddy's little girl."
Gwen Eckholm called Rowan -- her former neighbor in Mesa, Arizona, who recently moved to eastern Oregon -- a "very intelligent, super-nice guy" who told her he felt safe working in Algeria.
He said "we're in a compound in the middle of nowhere, and we've got security, and I'll be fine," Eckholm told CNN affiliate KNXV. "I guess you can't really be secure any place."
CNN's Yoko Wakatsuki, Hamdi Alkhshali and Greg Botelho contributed to this report.