Freed British hostages Peter (left) and Alan (right). No surnames available

Mr Cameron said: "We now know that three British nationals have been killed, and a further three are believed to be dead. A further British resident is also believed to be dead.

"I know the whole country will want to join me in sending our sympathies and condolences to the families who have undergone an absolutely dreadful ordeal, and now face life without these very precious loved ones."

1/5

Gallery: Algeria Hostage Ordeal: First Pics

The first images, said to show the ordeal faced by those who were taken hostage, that were broadcast on Algeria's Ennahar TV.

He described the attack as a "stark reminder" of the continuing terrorist threat and vowed 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."

The over all death toll is now said to have risen to 81, according to Algerian security sources, with 107 foreign workers and 685 local employees released.

The private Algerian television channel Ennahar is also reporting that five kidnappers have been found, still alive.

Despite this, the Algerian oil minister has said that operations at the plant will resume in two days.

Scotland's First Minister Alex Salmond said two Scots, or people with immediate family connections in Scotland, are believed to have been killed.

Carlos Estrada, a Colombian man who lived in London with his family and worked for BP, has been confirmed dead by President Juan Manuel Santos.

At least one American died before Saturday's assault, and Japanese engineering firm JGC Corp said 10 of its Japanese and seven of its foreign workers are still unaccounted for.

Despite the major loss of life, Mr Cameron refused to criticise Algeria's handling of the crisis.

"The responsibility for these deaths lies squarely with the terrorists who launched these vicious and cowardly attacks," he said.

Video:Algeria Crisis Sharpens Mali Focus

"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."

He added: "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.

"It is linked to al Qaeda, it wants to destroy our way of life, it believes in killing as many people as it can.

"We need to work with others to defeat the terrorists and to close down the ungoverned spaces where they thrive with all the means that we have."

Foreign Secretary William Hague said 22 British nationals had survived the crisis and were already back in the UK.

Britain's ambassador is currently in Algiers and will travel to the south of the country today to help any other Britons trying to leave.

He told Sky's Murnaghan show: "These are cold-blooded murderers and we must remember that. There is no political excuse that justifies behaving in this way."

He also defended Algeria's response, revealing that he had been told the terrorists had been planning to blow up the whole installation - causing even more deaths.

The drama started on Wednesday when a group of around 30 heavily-armed militants mounted a dawn raid on the plant which is close to the Libyan border.

They seized hostages from among the 700 Algerian and foreign workers at the site. Two members of staff, including one Briton, died in the initial assault.

Algerian special forces mounted an operation to take back the plant 24 hours later, without informing any other governments in advance.

The Algerians insisted later that they had to act due to fears that the militants were about to flee into the desert, taking hostages with them.

By Friday, it was being claimed that around 100 foreigners - from a total of 132 - and 573 Algerians had been freed.

Provisional figures put the death toll at 12 hostages and 18 militants but it was clear one group of terrorists was still holding out.

On Saturday, Algerian troops launched a final assault on the site and brought the stand-off to a bloody conclusion.

The state news agency, APS, reported that the terrorists had executed seven of the remaining hostages before they themselves were killed.

Troops later found an arsenal of six machine guns, 21 rifles, two shotguns, two 60mm mortars with shells, six 60mm missiles with launchers, two rocket-propelled grenades with eight rockets and 10 grenades in explosive belts.

The terrorists also booby-trapped the sprawling plant with explosives before the last shoot-out.

"To avoid a bloody turn of events in response to the extreme danger of the situation, the army's special forces launched an intervention with efficiency and professionalism to neutralise the terrorist groups that were first trying to flee with the hostages and then blow up the gas facilities," it said in a statement.

The kidnappers are part of the Masked Brigade - a terrorist splinter group led by the veteran jihadist, Mokhtar Belmokhtar, which broke away from al Qaeda in the Islamic Maghreb.

They initially claimed the attack was in retaliation for the French military intervention in neighbouring Mali.

It was subsequently reported that they were demanding the release of two terrorists held in the US, including 1993 World Trade Centre bombing mastermind Omar Abdel Rahman, in return for the release of two US captives.

Belmokhtar has reportedly claimed responsibility for the attack and called on France to halt air strikes in Mali.

The video was not shown and it is not immediately possible to verify the information.

The Mauritanian news agency, ANI, also carried a statement apparently from the group which warned further strikes on nations involved in combating the Mali rebels.

It said: "We remind our Muslim brothers of the need to clear out from sites run by foreign companies, especially the French ones, to save their lives."

Algeria has fought its own Islamist rebellion since the 1990s, elements of which later declared allegiance to al Qaeda and then set up new groups in the poorly patrolled wastes of the Sahara, where they flourished.