Three Britons confirmed dead in Algeria - PM
Three Britons are confirmed dead and three more are believed to have died after the Algeria hostage crisis, the prime minister has said.
Another UK resident is also thought to be dead. The figures include a Briton who was killed on Wednesday.
The 22 other Britons who survived the crisis are now back in the UK.
Five suspected members of the Islamist group which held foreign and local workers hostage at an Algerian gas plant have been arrested, reports say.
After a raid by Algerian troops ended a four-day siege at the In Amenas gas facility on Saturday, at least 23 hostages and 32 militants are reported to have died.
Algeria's minister of communications said the final death toll might rise and there would be an announcement in the next few hours.
Algerian officials said the hostage-takers - from six different nationalities - belonged to a new Islamist group formed by a veteran Algerian militant and kidnapper, Mokhtar Belmokhtar, who recently broke from al-Qaeda.
Mauritanian website Sahara Media says he has claimed responsibility for it in a video message.
He said the operation had been led by 40 migrants from "several Islamic countries, even from the Western countries".
The video is said to have showed Belmokhtar saying he was prepared to negotiate with Western and Algerian leaders if French military offensive against Islamists in Mali were stopped.
But analysts have pointed out the assault on the gas facility was well-planned and was unlikely to have been launched in retaliation for the French action.
Speaking at Chequers, Mr Cameron said the attack was a "stark reminder" of the continuing terrorist threat and pledged to use Britain's chairmanship of the G8 to ensure that it was at the top of the international agenda.
"This is a global threat and it will require a global response. It will require a response that is about years, even decades, rather than months," he said.
"It requires a response that is patient and painstaking, that is tough but also intelligent, but above all has an absolutely iron resolve and that is what we will deliver over these coming years."
British survivors have been flown back to the UK on government and BP-chartered flights overnight, and are now being reunited with their families.
Scotland's First Minister Alex Salmond said eight Scottish survivors were now back in the UK but added: "We know that that two Scots, or people with immediate Scottish family connections, are believed to have been killed."
One hostage - Alan Wright, 37, from Aberdeenshire - described hiding in an office when the Islamists attacked, before cutting through a fence and escaping.
He told Sky News: "If you have been captured, there's pretty much no escape and it is going to take a miracle to get you out."
The crisis began on Wednesday when militants attacked two buses carrying foreign workers to the remote site in south-eastern Algeria. A Briton and an Algerian reportedly died in the incident.
The militants then took Algerians and foreign workers hostage at the complex, which was quickly surrounded by the Algerian army.
The Algerian armed forces attacked on Thursday as militants tried to move some of their captives from the facility.
Mr Cameron paid his condolences to the bereaved families, who had undergone "an absolutely dreadful ordeal".
He said questions would be asked about the Algerian response to the crisis, but added: "The responsibility for these deaths lies squarely with the terrorists who launched these vicious and cowardly attacks.
"When you are dealing with a terrorist incident on this scale, with up to 30 terrorists, it is extremely difficult to respond and get this right in every respect."
The prime minister said that there were clear similarities with the terrorist threat from Afghanistan and Pakistan, although it was on a different scale.
"What we face is an extremist, Islamist, al-Qaeda-linked terrorist group. Just as we had to deal with that in Pakistan and in Afghanistan so the world needs to come together to deal with this threat in north Africa," he said.
State news agency APS said 685 Algerian workers and 107 out of 132 foreigners working at the plant had been freed.
The nationalities of some of the hostages killed are still not known, but as well as the Britons, US, Norwegian, and Japanese nationals are also missing.
A Colombian citizen resident in the UK is believed to be among the dead.
No details have been given by officials of the British hostages, but some details have emerged of those who survived.
Two of the survivors have been named as Lou Fear, 56, from Louth in Lincolnshire and Allen McCloud, 53, from Plymouth in Devon.
Mr McCloud's brother, Malcolm, told the BBC: "We are all very relieved that Allen is now safe, it's been a long stressful four days for the family. Our thoughts are now with the other families who were not so lucky as us."
But he went on to criticise the British authorities and for BP and Orion for failing to keep their father, who lives in Thailand, informed.Three Britons dead in Algeria - PM
He said: "The lack of information from all the relevant sources was very poor. We were kept up to date from friends who worked in the oil and gas industry and the news."
Other freed hostages have been named as Iain Strachan, 38, from Howwood in Renfrewshire; Darren Matthews, from Saltburn-by-the-Sea, Teesside; Mark Grant, 29, from Grangemouth, near Falkirk; Alan Wright, 37, from Portsoy in Aberdeenshire; Peter Hunter, 53, from County Durham; David Murray, 47, from Kirkby in Merseyside; Huw Edwards, 55, from Macclesfield in Cheshire; and Stephen McFaul, 36, from Belfast.
One Algerian worker told the Associated Press that at one point the militants caught a man he described as a Briton.
The man, who gave his name only as Chabane, said: "They threatened him until he called out in English to his friends, telling them, 'Come out, come out, they're not going to kill you. They're looking for the Americans'.
"A few minutes later, they blew him away," he said. Chabane's account could not be independently confirmed.
The In Amenas gas field is situated at Tigantourine, about 40km (25 miles) south-west of the town of In Amenas and 1,300km (800 miles) south-east of Algiers.
The plant is jointly run by BP, Norway's Statoil and Algeria's state-owned oil company.