An Algerian army operation to free hostages at a gas facility in the desert has left a number of Islamist militants and their captives missing.
State TV said four foreign hostages had been killed in the raid. The militants had claimed to be holding 41.
Some hostages were freed, but the number of survivors was unconfirmed and UK officials said they were preparing for news of many British casualties.
Al-Qaeda-linked fighters occupied the facility near In Amenas on Wednesday.
During Thursday's raid many Algerian and four foreign hostages - two from Scotland, one from France and one from Kenya - were freed, state news agency APS reported.
The Irish government confirmed that one of its citizens was free. Five American hostages had survived and left the country, US officials told ABC News.
Japan said three of its nationals had been freed in the operation, but that 14 remained unaccounted for.
Earlier, the militants reportedly said that at least 34 hostages and 14 kidnappers died, and that seven foreign hostages had survived.
Late on Thursday. AFP news agency quoted Algerian officials as saying the army had not secured the whole site and that it was still being searched.
The militants said they had taken hostages in retaliation for French military intervention in neighbouring Mali.
Algerian Communications Minister Mohamed Said Belaid said a "significant number of terrorists" had been killed.
He added: "Unfortunately, we deplore some deaths and some people wounded. We don't yet have the numbers," he said.
BBC political editor Nick Robinson says British ministers are still awaiting information from the Algerian government on the number of British dead, adding that up to 20 hostages were still thought to be unaccounted for.
Details of how the raid unfolded were slow to emerge.
APS reported that the Algerian military, which had been surrounding the gas plant, had targeted two vehicles as they tried to escape from the site with an unknown number of people on board.
Militants told local media that Algerian forces had used helicopter gunships in the operation.
Irish Deputy Prime Minister Eamon Gilmore said one Irish hostage, Stephen McFaul, escaped in the confusion when the army tried to stop the militants moving their captives in a convoy of around five vehicles.
Mr McFaul and other hostages were made to wear vests covered in plastic explosives as they were being moved, Mr Gilmore told CNN.
Norwegian Prime Minister Jens Stoltenberg said he was told by his Algerian counterpart that the army "felt they had no choice but to go in".
Mr Cameron, who cancelled a key speech on Europe scheduled for Friday, made it clear that he would have preferred to have been told in advance, a spokesman said.
The British government had offered Algeria advice on how to deal with the siege situation - whether through negotiations or a military solution - because the Algerian government lacked the expertise to deal with it, our correspondent says.
There was great concern in the UK and other Western nations when the Algerian authorities said the military had been sent in, he adds.
Japan's government protested against the raid, urging Algeria "put the highest priority on people's lives". The US said it was "seeking clarity" on what had happened.
Algerian Interior Minister Daho Ould Kablia said the kidnappers were Algerian and operating under orders from Mokhtar Belmokhtar, a senior commander of al-Qaeda in the Islamic Maghreb (AQIM) until late last year.
Mr Ould Kablia said they had entered Algeria from Libya, AFP reported.
Two people were killed when militants attacked the gas plant.
The Tigantourine gas facility is about 40km (25 miles) south-west of In Amenas, which is close to the Libyan border and about 1,300km (800 miles) south-east of Algiers.
BP operates the gas field jointly with Algerian state oil company Sonatrach and Norwegian firm Statoil.