(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 one Algerian, three Americans, three Britons and six Filipinos, 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 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.
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."
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.
Ten Japanese remain unaccounted for, according to JGC, a Yokohama-based engineering firm. Japan is sending a second team that includes doctors to the scene of the standoff. Other government officials have been at the site since last week.
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.
CNN's Yoko Wakatsuki contributed to this report.