The West's fight against al Qaida is like the battle against revolutionary communism, former prime minister Tony Blair has said as he warned it could last for a generation.
He said Britain was right to send troops to support the French effort in Mali to put down a terrorist attempt to overthrow the country's government.
Prime Minister David Cameron faced difficult decisions to fight terrorism, Blair said, but warned the cost of standing aside would be far greater.
Britain at least had to try and "shape" events in the Middle East, he added, telling the BBC's Andrew Marr show that in Syria there was already a danger the more extreme elements of the opposition forces fighting president Bashar Assad's regime would take over.
Blair said: "I think we should acknowledge how difficult these decisions are.
"Sometimes in politics you come across a decision which the choice is very binary, you go this way or that way and whichever way you go the choice is very messy.
"If we engage with this, not just military but over a long period of time, in trying to help these countries, it is going to be very, very hard but I think personally the choice of disengaging is going to be even greater."
A Tiger helicopter lands at the Mopti airport, in Sevare
He added: "We always want in the West, quite naturally, to go in and go out, and think there is a clean result. It's not going to happen like that. We now know that. It is going to be long and difficult and messy.
"My point is very simple though: if you don't intervene and let it happen, it is also going to be long, difficult and messy, and possibly a lot worse. It's a very difficult decision.
"We are certainly talking about a generation. I think a better way to look at it is like the fight the West had over a long period of time with revolutionary communism.
"It will happen in many different theatres, it will happen in many different ways but the truth is that you have no option but to confront it, to try over time to defeat it."
A young Malian, who fled the violence in the historic city of Timbuktu, carries a cup in a refugee camp
Blair said French president Francois Hollande was "courageous" to intervene in Mali and warned that all "options" had to be considered when dealing with Syria.
He said the West could not rely on Russia to change its position on Syria, adding we "don't want to put all our eggs in that basket".
He said: "I do think that there are certain things we could do to strengthen the opposition and make it clear to Assad that in the end he is not going to win this, and he is not going to have a stalemate.
"It will end in defeat and it will end in his going, so the question is that is he prepared to do this on a basis that will allow us some chance to stabilise the country afterwards?
"Otherwise, the risk is that, and you see this from other countries that have been through the process of a revolution, you end up with a situation where the state starts to collapse.
"I don't think you are ever going to go in the sense of British troops on the ground but the question is what more you can do to help the opposition, and there are options there which are important to look at."
A Malian man, Sadou, poses at his home with a machete to protect himself in case of attacks by Malian Islamist rebel groups
Blair said it was also necessary to build "capacity" in countries which needed support to deal with extremism while at the same time fighting al Qaida by better educating children in countries where al Qaida operated.
There was now an "identifiable ideology" visible in north Africa, the Middle East and central Asia, he added. But the "good news", Mr Blair said, was that the majority of people in countries affected by al Qaida wanted more prosperity.
He said: "My fear is that because this is being driven by an ideology with a very, very strong desire to push out from the borders of wherever they are, if we do disengage we will get a different set of problems further down the line which are more profound and more serious. That's the choice."
Suggested For You
SUBSCRIBE AND FOLLOW
Get top stories and blog posts emailed to me each day. Newsletters may offer personalized content or advertisements.Learn more