The last weeks have seen a ghastly roll call of terror attacks in the obvious places: Syria, Libya, Iraq and Lebanon, as well as Egypt, Yemen, Tunisia and Pakistan. Also suffering are places where we have only in recent years seen such violence: Nigeria, and in many parts of central Africa, in Russia and across central Asia, and in Burma, Thailand and the Philippines. We can either see all of these acts of killing as separate – produced by various political contexts – or we can start to see the clear common theme and start to produce a genuine global strategy to deal with it.

The fact is that, though of course there are individual grievances or reasons for the violence in each country, there is one thing self-evidently in common: the acts of terrorism are perpetrated by people motivated by an abuse of religion. It is a perversion of faith. But there is no doubt that those who commit the violence often do so by reference to their faith and the sectarian nature of the conflict is a sectarianism based on religion. There is no doubt either that this phenomenon is growing, not abating.

We have to be prepared to take the security measures necessary for our immediate protection. Since 9/11, the cost of those measures, and their burden, has been huge. However, security action alone, even military action, will not deal with the root cause. This extremism comes from a source. It is not innate. It is taught. It is taught sometimes in the formal education system; sometimes in the informal religious schools; sometimes in places of worship and it is promoted by a vast network of internet communications.

Technology, so much the harbinger of opportunity, can also be used by those who want to disseminate lessons of hate and division. Today's world is connected as never before. This has seen enormous advances. It means there is a kind of global conversation being conducted. This is exciting and often liberating. But it comes with the inevitable ability for those who want to get across a message that is extreme to do so. This has to be countered.

At present, our screens are dominated by the hideous slaughter in Syria. We have to hope that the peace negotiations succeed. But with more than 130,000 dead – and, on some accounts, the total is nearer 200,000 – millions displaced and the country in a state of disintegration, it is hard to see how there can be a lasting agreement for peace unless it is based on a clear recognition that the Syria arising from this has to be one in which all people are treated equally, regardless of which faith they practise or which part within a faith they belong to. That will never work while either a minority religious group rules the country whose majority has a different adherence, or where those fighting the regime have powerful elements that also want to rule on the basis of religious difference – and are prepared to use terrorism to get their way.

This is not just a matter of what any new constitution says. Democracy is not only a way of voting. It is a way of thinking. People have to feel equal, not just be regarded by the law as such. Such religious tolerance has to be taught and argued for. Those who oppose it have to be taken on and defeated not only by arms but by ideas.

All over the region, and including in Iraq, where exactly the same sectarianism threatens the right of the people to a democratic future, such a campaign has to be actively waged. It is one reason why the Middle East matters so much and why any attempt to disengage is so wrong and short-sighted. It is here in the centre of Islam that so many of the issues around how religion and politics coexist peacefully will be determined.

But this issue of extremism is not limited to Islam. There are also many examples the world over where Muslims are the victims of religiously motivated violence from those of other religious faiths.

So the challenge is clear. And it is one that could define the nature of peace and conflict in the first half of the 21st century. The battles of this century are less likely to be the product of extreme political ideology – like those of the 20th century – but they could easily be fought around the questions of cultural or religious difference.

The answer is to promote views that are open-minded and tolerant towards those who are different, and to fight the formal, informal and internet propagation of closed-minded intolerance. In the 21st century, education is a security issue.

For that reason, when I left office, and in part based on my experience post-9/11 of how countries whose people were freed from dictatorship have then had democratic aspirations thwarted by religious extremism, I established a foundation whose aim is to promote greater knowledge and understanding between people of different faiths. This is not a call to faith – it is a call to respect those of all faiths and not to allow faith to divide us but instead to embody the true values of compassion and humanity common to all faiths.

The foundation is now active in more than 20 countries, including some of those most affected by sectarianism, with a multimillion-pound budget, full-time and part-time staff, and expanding rapidly. We focus on practical programmes. The schools programme, accredited to the international GCSE and recognised by the international baccalaureate, uses video conferencing and online interaction to link classes of students from different countries across the world to learn about each other and to learn to live with each other.

There is a university programme, which we are building into a minor degree course, that began at Yale but is now in more than 20 universities, including in China and Latin America, where students study faith and globalisation – essentially the place of religion in modern society. And an action programme, pioneered in Sierra Leone but now being extended, where we help deliver the anti-malaria campaign of the UN by using the faith infrastructure of the churches and the mosques.

Later this year, in collaboration with Harvard Divinity School, we will launch a new website that will provide up-to-date analysis of what is happening in the field of religion and conflict; in-depth analysis of religion and its impact on countries where this is a major challenge; and basic facts about the religious make-up and trends in every country worldwide.

Evidently, we can reach only parts of the world and be a small part of fighting a huge problem. But the purpose is to change the policy of governments: to start to treat this issue of religious extremism as an issue that is about religion as well as politics, to go to the roots of where a false view of religion is being promulgated, and to make it a major item on the agenda of world leaders to combine effectively to combat it. This is a struggle that is only just beginning.

Comments will be opened later this morning