A final assault by Algerian special forces on the group of jihadist hostage-takers who seized the In Amenas gas facility ended on Saturday with the deaths of the seven remaining foreign hostages. Also killed was the Niger terrorist believed to lead the al-Qaida splinter group's leader, Abdul Rahman al-Nigeri. Five Britons and one UK resident were believed to be among the 23 hostages killed during the standoff

Sixteen foreign nationals – including two Americans, two Germans and a Portuguese – were freed during Saturday's operation.

After a day of desperate uncertainty over the fate of the remaining British captives, David Cameron said the deaths would unite world leaders in the cause of defeating global terrorism. The prime minister added: "Our determination is stronger than ever to work with allies right around the world to root out and defeat this terrorist scourge and those who encourage it."

The White House released a statement from Barack Obama, in which the US president said: "The thoughts and prayers of the American people are with the families of all those who were killed and injured in the terrorist attack in Algeria. The blame for this tragedy rests with the terrorists who carried it out, and the United States condemns their actions in the strongest possible terms. We have been in constant contact with Algerian officials and stand ready to provide whatever assistance they need in the aftermath of this attack.

Announcing the latest casualties, foreign secretary William Hague said: "We believe that there are five British nationals and one British resident who are either deceased or unaccounted for, in addition to the one fatality that we had already confirmed."

He added: "We are working hard to get definitive information about each individual. We are in touch with all of the families concerned."

First reports suggested the hostages were killed by their captors as the attempt to rescue them was launched. Official sources quoted by the Algerian newspaper El Watan said the militants executed them after having given up hope of escape. The Niger terrorist believed to have led the al-Qaida splinter group behind the hostage-taking, Abdul Rahman al-Nigeri, was also killed during the final assault. Algeria's interior ministry said that 23 captives and 32 kidnappers had died during the four-day hostage crisis.

The 11 surviving Islamist fighters from the group of 40 who attacked the desert plant last Wednesday were also killed in the raid on a workshop where they had taken their captives.

The state oil and gas company, Sonatrach, said the hostage-takers, who identified themselves as Those Who Sign in Blood – a splinter group of al-Qaida in the Islamic Mahgreb – had boobytrapped the complex with explosives. Earlier on Saturday, Algerian special forces found 15 burned bodies at the plant. Details of the operation's bloody end emerged as it was revealed that the UK had offered assistance to the Algerian government, reportedly including British special forces. The offer was apparently rejected by Algeria.

The hostage crisis began when two groups of Islamists attacked two buses carrying foreign workers then took hundreds of Algerians and expatriates hostage at the complex. The group had been demanding the cessation of a French military operation against Islamists in northern Mali as well as the release of two men jailed in the US.

Last Thursday, Algerian special forces mounted an operation to take back the plant – to the initial dismay of the British and other governments, which were not notified in advance.

According to early accounts to emerge from In Amenas, Saturday's raid was launched after Nigeri and his group threatened to blow up the plant and kill the remaining hostages. The decision to go in was made after attempts by the terrorists to sabotage and mine the plant were detected overnight on Friday. According to El Watan, the hostage- takers had tried to sabotage the gas installation by starting a fire, but it was quickly extinguished.

"The terrorists were prepared to commit a collective suicide; the army's intervention led to their neutralisation. Unfortunately, the hostages were executed," the newspaper said.

The crisis, Hague said, was a reminder of "the scale and ruthlessness of the terrorist threat that we and other nations face". One senior government source said that London had been hampered by a continuing lack of information from the Algerian government.

Cameron, who had to postpone a major speech on Europe on Friday to handle the crisis, spoke to the Algerian prime minister Abdelmalek Sellal , who confirmed the military operation was "effectively ended".