Hostages missing after Algerian raid on Amenas plant Watch
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.
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.
The UK is mourning the potential loss of several of its citizens.
The UK is also curious as to why Algeria proceeded with this operation despite oposition from several governments.
We are also somewhat shocked by Algeria's decision to go ahead with this raid, despite opposition from other leaders. In addition to this, we would like to know why Algeria did not inform the UK and other nations prior to taking action.
We understand Algeria's stance against any form hostage negotiations, but hopes it understands false negotiations could have been held, which would have provided the military with more time to prepare.
The Canadian government is also perplexed as to why Algeria proceeded with the raid and echoes the United States' sentiment of seeking clarity as to what happened.
The Hashemite Kingdom of Jordan also echoes the above sentiments. However, we would like to add that we abhorr terrorism in all its forms whether it be from Islamic or non Islamic extremists whether it be on our soil or not. We have confidence that Algeria will defuse the situation and any other situation from escalating.
The Republic of India sends its deepest condolences to those whom have lost their lives. We would also add that we have complete faith in any Anglo-Algerian cooperation in containing and preventing situations like this from happening on Algerian soil.
OOC: Before anybody goes :O *******s nabbed three countries. I've been permitted by Birchington and Cheese_Monster to take over from him whilst he's off in sunny Australia travelling. So expect more posts by me.