It is thought 11 Islamist militants, including their Algerian leader Tahar Ben Cheneb, a prominent commander in the region, were also killed in the facility at Tigantourine plant, near In Amenas, according to Algerian security sources.
However, the numbers of Britons killed in the crisis could rise, prompting the Prime Minister David Cameron to warn the country that it should prepare for the worst – just hours after two Scots and Northern Irishman Stephen McFaul, 36, escaped or were freed from their ordeal which began on Wednesday.
Last night, Mr Cameron cancelled a trip to deliver a keynote speech on Europe in Amsterdam so he could chair meetings of the UK Government's Cobra emergency committee – but he was clearly angered he had not been informed of the decision to send in troops by his Algerian counterpart.
The hostages were killed in what the Foreign Office described as "an appalling tragedy" as troops moved to confront Islamic militants who claimed to have taken more than 40 hostages.
In addition to the British dead, eight were Algerian and seven were other foreigners, including two Japanese and a French national. However, the nationalities of 15 of the victims had yet to be established.
Mr Cameron protested to Algerian Prime Minister Abdelmalek Sellal over the failure to warn Downing Street before launching the raid.
Speaking before news of the second British death, he 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."
Algerian communications minister Mohamed Said Belaid said: "Unfortunately we deplore some deaths and some people wounded. We don't yet have the numbers."
He said the assault on the plant "was successful in neutralising a large number of terrorists and freeing a large number of hostages".
Islamic extremists launched the attack in revenge for France's crackdown on rebels in neighbouring Mali. Britain is providing non-combat role support and so became a target.
Cigarette smuggler Mokhtar Belmokhtar, who is nicknamed Mr Marlboro, is accused of ordering the attack for the al-Qaeda-affiliated Signed-in-Blood Battalion.
Algerian forces yesterday mounted an assault on the Saharan gas plant with helicopter fire hours after militants threatened to detonate explosives attached to the hostages if they were attacked.
Nearly 600 Algerian workers and four foreign hostages – two from Scotland, one from France and one from Kenya – were freed during the operation, the state news agency said. But it said sources indicated half of the foreign hostages had been released, without specifying their number or nationality.
It emerged on Wednesday, after the crisis began, that Mr Cameron offered British help in rescuing the hostages in a phone call to Mr Sellal.
It was only at 11.30am yesterday when Mr Cameron called again that the military raid was confirmed.
Downing Street said the Algerians had clearly decided they had to act "urgently".
"The Algerian prime minister explained the situation was extremely fast moving and that in the Algerian government's judgment they needed to act immediately," said a Number
10 spokesman. Mr Cameron said that officials in the Cobra emergency committee were "working around the clock to do everything we can to keep in contact with the families, to build the fullest possible picture of the information and the intelligence we have".
Foreign Secretary William Hague has cut short a visit to Australia due to the crisis, while ministers are planning to make a statement to Parliament this morning.
First Minister Alex Salmond told the Scottish Parliament Scots were caught up in the incident and described it as a "hugely serious situation". He said information on the hostages was limited "in the interests of the safety and security of the hostages".
He added: "The priority is their safety and, of course, to keep families informed."
Claims of responsibility have come from two groups, the Katibat Moulathamie, or the Masked Brigade, and by one calling itself Signers in Blood.
l Liberal Democrat MEP Graham Watson faced fierce criticism after a tweet from his account read: "Al Qaeda 1, @David-Cameron 0."