David Cameron has warned that the fight against terrorism in north Africa could go on for decades as he confirmed that six Britons and a British resident are believed to have died in the Algerian hostage crisis.

The prime minister said the seizure of a Saharan gas facility by a group of international jihadists last week was a stark reminder of the threat from terrorism the world over.

He pledged a global response to what he described as a global threat.

"It will require a response that is about years, even decades, rather than months," Cameron said. "Tragically, we now know that three British nationals have been killed, and a further three are believed to be dead. And a further British resident is also dead."

The prime minister said the "whole country" would join him in sending condolences to the victims' families.

Cameron was speaking hours before the first of the British victims was identified on Sunday night as Paul Thomas Morgan, 46.

In a statement issued by the Foreign Office, his family described him as a "true gentleman" who "loved life and lived it to the full" and "died doing the job he loved".

Morgan was reported to have been a veteran of the 1991 Gulf War and former French Foreign Legionnaire working as a liaison between workers and local security staff. Originally from Liverpool but now living in Spain, he was said to have been in a bus going to the airport to return home following a one-month stint when the attack happened.

The prime minister's statement is a recognition that the Arab spring has irrevocably changed the dynamics of the wider region, ushering in new democratic possibilities but also dangers from unpredictable, ruthless and well-organised extremist groups.

Asked if the current al-Qaida threat to north Africa was comparable to the threat in Afghanistan a decade ago, Cameron replied: "It is different in scale but there are similarities."

He added: "What we face is an extremist Islamist violent al-Qaida-linked terrorist group – just as we have to deal with that in Pakistan and Afghanistan."

A further 22 Britons involved in the crisis at the In Amenas gas facility have returned to the UK, the Foreign Office said. The Algerian authorities said they had captured alive six members of the militant group during a search of the complex.

Amid confusion about what precisely happened on Saturday, the death toll climbed to at least 81 on Sunday as Algerian forces searching the refinery for explosives found dozens more bodies, many so badly disfigured it was unclear whether they were hostages or militants, a security official said.

The Algerian authorities said after the assault that at least 32 extremists and 23 hostages were killed, but Algerian bomb squads sent in to blow up or defuse explosives were said to have found 25 bodies where were difficult to identify.

Speaking on Sunday, Alan Wright, who survived the attack, described how he hid in an office after the jihadists stormed the compound last Wednesday.

Wright, 37, a BP employee, said he eventually joined Algerian colleagues who fled by cutting their way out through a fence.

"If you have been captured, there's pretty much no escape and it is going to take a miracle to get you out," he told Sky News. He said the expatriates were surprisingly calm as word of the attack spread with everyone "going into safe mode".

The most chilling moment came when one of the hostage-takers walked past their building and said good morning in a friendly Arabic voice, trying to trick the foreigners out, he said. "That was the first moment when we thought we are in big trouble here," Wright said.

Speaking on the BBC's Andrew Marr Show, William Hague, the foreign secretary, said it was "quite likely" some of the Britons were executed by the hostage-takers, who identified themselves as the Signers in Blood – a splinter group of al-Qaida in the Islamic Mahgreb (AQIM).

Communications minister Mohamed Said admitted the final death toll "strongly risked being revised to a higher figure". Earlier, the Algerian authorities had said 107 foreign hostages and 685 Algerian nationals were freed.

Among those reportedly shot dead was Abdul Rahman al-Nigeri, a terrorist from Niger, who is thought to have led the jihadist group that attacked the desert plant, initially ambushing a convoy of buses leaving with expats for the airport. The attackers came from six different countries, Said said. At least eight Algerian hostages died, together with nine Japanese nationals and one from France. One American was confirmed dead.

Statoil, the Norwegian company that runs the plant alongside Britain's BP and Algeria's state oil company, said five Norwegian staff were missing.

Cameron told the Commons on Friday he was disappointed not to have been informed about the Algerian military assault. On Sunday, however, the prime minister refrained from criticising Algeria's handling of the hostage crisis, noting that Algerian soldiers had also died.

He stressed that responsibility for the "vicious and cowardly attack" lay squarely with the terrorists. He added: "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."

France's foreign minister, Laurent Fabius, also expressed solidarity with Algeria, which has battled a major Islamist insurgency since the 1990s. Fabius said: "Faced with terrorism, we have to be unwavering. These are killers, they pillage, they rape, they sack."

The situation was dreadful, he said, adding: "The Algerians know at what point terrorism is an absolute evil."

Fabius rejected suggestions that he was being soft on Algeria because France needed – and had been given – permission by Algiers to overfly its territory during France's military intervention in neighbouring Mali.

US president Barack Obama said the US would ask Algeria for a full explanation of what happened, but said: "The blame for this tragedy rests with the terrorists."

Cameron will chair a meeting of the government's crisis response committee, Cobra, to discuss Algeria on Monday, and will make a statement on the attack in the Commons. The National Security Council is meeting on Tuesday to discuss the threat posed by AQIM. "We have already been looking a lot at the threat posed by AQIM, but more work will need to be done," said a source.

David Hartwell, an analyst with IHS Jane's, questioned whether "al-Qaida" was the best way to describe a diverse and fluid network of local Islamist groups across north Africa. The faction that carried out last week's assault is led by Mokhtar Belmokhtar, a jihadist known for cigarette smuggling and nicknamed "Mr Marlboro".

"Belmokhtar is a bit of a loose cannon and has been for decades," Hartwell said. "He's always been more of a warlord interested in smuggling and making money than fighting for any particular cause. Perhaps he was being sub-contracted in this instance. All these groups pay lip service to the al-Qaida brand, but they are more plugged into regional dynamics."

In a video on Sunday, Belmokhtar reportedly claimed responsibility. He said the raid on the gas plant had been carried out by al-Qaida in protest at France's bombing of Muslims in Mali. He said he was prepared to "negotiate with the west" if French attacks on Islamist militants in northern Mali were halted.

Hartwell said nobody should be surprised at the bloody denouement to the hostage crisis. Algeria's security forces had used brutal tactics to suppress Islamist militancy for two decades. "They reacted to the hostage crisis in traditional style. That's the way they operate," he said.