Mr Cameron said the attack was a "stark reminder" of the continuing terrorist threat and vowed to use Britain's chairmanship of the G8 to ensure that it was right 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."
Despite the high death toll - with 23 hostages and 32 terrorists known to have died - the Prime Minister refused to criticise the uncompromising stance taken by the Algerian government.
"The responsibility for these deaths lies squarely with the terrorists who launched these vicious and cowardly attacks," he said.