(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."