Tony Blair has given his firm backing to David Cameron’s “generational
struggle” against terrorist groups in north Africa.

The former prime minister said Britain “cannot afford” to allow large areas of the world to “fall under the control of those determined to export their brand of violence and hatred”.

Writing in The Sun Mr Blair warned that the battle against terrorists in Africa is “one we cannot shirk” and that last week’s Algerian hostage crisis is a reminder that "the threat from violent extremism has not gone away".

Mr Cameron has said that British intelligence officers, Special Forces soldiers, aircraft and surveillance drones will all be deployed to “dismantle” terrorist groups based in northern Mali.

He said that Britain is now engaged in “generational struggle” against al-Qaeda affiliates like the group behind last week’s hostage crisis, whose leadership is based in Mali.

At least 38 workers at a gas plant were killed when al-Qaeda-linked terrorists took them hostage last week, including up to six British citizens.

“The terrible slaughter of innocent hostages in Algeria has brought this country together in shock and grief,” Mr Blair said.

“It is impossible to imagine the ordeal of the men involved or the trauma their families are suffering. They need all our support and sympathy.

“But the murders also reminded us that the threat from violent extremism has not gone away and must be faced down wherever we find it.

“We cannot afford to allow large areas of our world, no matter how remote or inhospitable they might seem, to fall under the control of those determined to export their brand of violence and hatred.”

Mr Blair said the “twisted ideology” of the terrorists in north Africa means they will “always to look to how they can cross more borders and destroy more lives”.

Mr Blair said that the Prime Minister is “right to warn that this is a battle for our values”.

"I wish I could say it was straightforward or that there will be no more tragedies,” he added.

"But David Cameron is right to warn that this is a battle for our values and way of life which will take years, even decades. It is also a battle we cannot shirk."

However the former prime minister also attacked those who claim that military interventions in foreign countries fuel terrorist attacks.

“There will be some, of course, who try to deflect the blame on to the French for their military intervention in support of the Malian government,” Mr Blair said.

“They will claim again that if only we in Europe or America did not interfere our citizens would be left in peace.

“I have no doubt that many expressing this view are sincere in their beliefs. But I am also certain they are totally wrong.”

Defending military interventions during the course of his leadership Mr Blair reiterated that “British forces have to be militarily involved wherever al-Qaeda threatens”.

“We cannot pull everyone back within our borders, nor guarantee their safety if we did. For we also found out on 9/11 what can happen if we allow a country, even a nation as far away as Afghanistan, to become a safe haven for violent extremists,” he added.

The lawless north of Mali is part of an "ungoverned space" in the Sahel region of Africa that Mr Cameron has said is a breeding ground for Islamic groups linked to al-Qaeda.

The focus has shifted to north Afrrica following the turmoil in Mali and last week's hostage crisis at In Amenas in southern Algeria.