Details are still sketchy, but it appears what Algerian special forces called a "final assault" on the Al Qaeda-linked gunmen ended in further bloodshed.
The Algerian army says its forces killed 11 Islamist militants remaining at the plant, but it is still not clear what nationalities the hostages who were killed were, or how many survived.
The assault comes more than 72 hours after the heavily armed militants staged a deadly raid on the complex, and two days after Algerian special forces launched a rescue bid widely condemned as hasty.
Unconfirmed reports said the Algerian forces intervened on Saturday after the hostage-takers started executing seven prisoners who were left after the first rescue attempt.
Algerian troops are now clearing any possible mines laid by the militants.
The interior ministry's statement said special forces had managed to free "685 Algerian workers and 107 foreigners".
Authorities say it will take time to determine the nationalities of those involved as many bodies were burnt after part of the facility was set alight on Friday night.
Officials from a number of countries are now trying to establish if their citizens were among the dead.
Britain's foreign secretary William Hague says the British ambassador to Algiers has been leading a UK team to the area.
"They have been helping British nationals to get away from the area, working with other countries and coordinating with the Algerian authorities," he said.
"We believe that there are five British nationals and one UK resident who are either deceased or unaccounted for, in addition to the one fatality that we had already confirmed."
Norway's Statoil says it is still missing five workers, all Norwegian nationals, after one more employee was brought to safety.
"We feel a deep and growing unease ... we fear that over the next few days we will receive bad news," chief executive Helge Lund told a news conference.
The US state department said on Friday one American, Frederick Buttaccio, had died but gave no further details.
'Appalling and unacceptable'
Algeria has been criticised for its tough handling of this crisis, as attacks on the kidnappers have resulted in a number of deaths of hostages in addition to those executed by their captors.
But British defence secretary Philip Hammond blames the loss of life squarely on the kidnappers.
"The loss of life as a result of these attacks is appalling and unacceptable," he said.
"We must be clear that it's the terrorists that bear sole responsibility for it.
"Their acts can never be justified and we remain determined to defeat terrorism and to stand with the Algerian government."
That sentiment was echoed by US president Barack Obama in his first comments on the hostage crisis.
"This attack is another reminder of the threat posed by Al Qaeda and other violent extremist groups in North Africa," Mr Obama said in a statement.
"In the coming days, we will remain in close touch with the government of Algeria to gain a fuller understanding of what took place so that we can work together to prevent tragedies like this in the future."
Oliver Tomdeer, one of the hostages who made it out at a checkpoint, said the Algerians who met him there were very happy.
"The guys who picked us up, the rescue guys who'd been in In Amenas, were wonderful," he said.
"They were like long-lost friends and they all said, 'this is not Algeria, terrorists do not come from Algeria, we are so embarrassed, we apologise'."
The attack on the plant swiftly turned into the biggest international hostage crises in decades, pushing Saharan militancy to the top of the global agenda.
It marked a serious escalation of unrest in north-west Africa, where French forces have been in Mali since last week fighting an Islamist takeover of Timbuktu and other towns.