An unknown number of hostages are thought to have been killed after Algerian military stormed a gas plant where they were being held by Islamist gunmen.
The nationalities of those killed in the assault is unknown, but David Cameron said Britain should be "prepared for the possibility of further bad news".
The Prime Minister has postponed his speech on Europe on Friday in the Netherlands to stay in the UK to deal with the situation.
Algeria's military launched a raid at the In Amenas complex, near the border with Libya. The country's state news agency APS said the army had ended its operation, reported the Associated Press.
Sky sources said the main accommodation complex had been secured, while a search was ongoing in a gas storage area.
The attackers were wearing military uniforms when they first took over the complex on Wednesday, Sky sources added.
Algerian communications minister Mohammed Said Belaid said Thursday's operation by the army was "successful in neutralising a large number of terrorists and freeing a large number of hostages but unfortunately, we are sorry to say, there were some deaths and injuries".
He added: "We do not yet have a definitive figure. As soon as we have it, we will make it public".
One British citizen is known to have died in the crisis, while several others were caught up in the drama.
Mr Cameron said: "We face a very bad situation at this BP gas compound in Algeria. A number of British citizens have been taken hostage.
"Already we know of one who has died. The Algerian armed forces have now attacked the compound."
He added: "It's a fluid situation, it's ongoing, it's very uncertain. We should be prepared for the possibility of further bad news, very difficult news, in this extremely difficult situation."
Foreign Secretary William Hague is cutting short a visit to Australia to return to the UK to help deal with the crisis.
Earlier, news agencies said some people had been killed in the wake of the strike by the Algerian military, while a number of hostages had reportedly been freed.
Mauritania's ANI news agency reported the deaths citing one of the kidnappers who had earlier taken 41 people, including Britons, captive at the compound.
And French president Francois Hollande said the hostage crisis was unfolding in "terrible conditions".
The official Algerian APS news agency said a number of foreign hostages were freed. Among those who managed to get out was 36-year-old Irishman Stephen McFaul from west Belfast.
His father, Christopher McFaul, told Sky News he was "delighted" by the news but added he felt "sorry for the other hostages that are still there". He also described the last 48 hours as "hell".
Stephen McFaul's son, Dylan, said: "I can't even explain the excitement. I can't wait until he gets home again." He added he would tell him "he's never going back there and I'm not letting him".
Japanese engineering firm JGC Corp said it had been able to contact three of its workers at the plant, but was unable to reach another 14.
APS said as many as 600 Algerian workers at the site managed to flee the plant, and an American military official said at least one US unarmed drone was flying over the complex.
News agency Reuters spoke to a local resident who said many people were killed in the military operation, which the Algerian government confirmed it was carrying out.
There have been conflicting reports as to the number of casualties, with Reuters citing a local source as saying six foreign hostages and eight rebels were killed.
ANI said the attackers' spokesman had claimed that Algerian forces opened fire as the militants tried to leave the energy complex with hostages.
The Algerian government said it had to act "immediately" to intervene in the crisis, according to Downing Street.
Mr Cameron's spokesman said Britain was not given prior notice of the operation, adding it was ongoing and the situation was "very grave and serious".
Mr Cameron was informed the operation was under way when he telephoned the Algerian prime minister at 11am on Wednesday, the spokesman added.
And the British PM made clear he would have preferred to be informed in advance of the military action, the spokesman went on.
The facility is run jointly by BP, the Norwegian energy firm Statoil and the Algerian state oil company.
On Wednesday a Briton and an Algerian were killed when around 20 gunmen from an al Qaeda-backed group stormed the facility.
Among the UK nationals taken hostage by the group were Scottish nationals, Scottish National Party leader Alex Salmond confirmed earlier.
Al Qaeda-linked militant group Katibat Moulathamine - The Masked Ones - said it was behind the attack.
The group said it was retaliating for French military intervention against al Qaeda-backed rebels in neighbouring Mali, where France now has 1,400 troops on the ground.
BP said it was evacuating a group of workers from Algeria in light of the hostage situation at the In Amenas complex.