Image copyright PA Image caption Tony Blair says the battle of ideas needs to "uproot the thinking of extremists"

A global drive is needed to tackle the roots of extremism by making education systems in all countries teach respect for other religions, Tony Blair says.

The former UK prime minister said it was "foolish" to spend billions on a military fight with Islamic extremism if intolerance is left "undisturbed".

As a matter of "urgent global importance", he wants schools to teach "the virtue of religious respect".

This should be made a "common global obligation", said Mr Blair.

In an article written for the BBC News Knowledge Economy series, Mr Blair said the struggle against the Islamic State and the threat of terrorism needed to engage in the battle of ideas.

"All the security measures and all the fighting will count for nothing," he said, unless the intolerant ideas that feed into extremist violence were challenged.

'Common obligation'

Mr Blair, who has set up a foundation promoting a greater understanding of religions, said it was necessary to "uproot the thinking of the extremists, not simply disrupt their actions".

Image copyright Reuters Image caption Thousands of Syrian Kurd families have been displaced by the advance of the Islamic State

"Especially foolish is the idea that we leave this process of the generational deformation of the mind undisturbed, at the same time as we spend billions on security relationships to counter the very threat we allow to be created."

He argued that a forum such as the G20 should adopt plans for "a common charter to be accepted by all nations, and endorsed by the UN, which makes it a common obligation to ensure that throughout our education systems, we're committed to teaching the virtue of religious respect".

"Muslim countries will continue to teach their children the value of being Muslim. But we should all teach that people who have a different faith are to be treated equally and respected as such."

Mr Blair said it was "perplexing and alarming" that the debate about radical Islamism too often failed to engage with education and the shaping of ideas.

The "incubators of radicalism" need to be confronted, he argued, to prevent the spread of ideas that "warp young and unformed minds".

"The challenge we face is to show young people who are vulnerable to appeals from terrorists that there is a better path to having their voice heard."

'Security issue'

Irina Bokova, director-general of the United Nations Educational, Scientific and Cultural Organisation (Unesco), has previously warned that neglecting education had become a "security issue".

The head of the UN agency said that poor quality education was creating a volatile mix in many developing countries of illiteracy, unemployment and the rise of extremism.

Despite a global millennium pledge for all children to have access to primary school by 2015, Unesco says this target is almost certain to be missed.

International agencies have also highlighted a pattern in which students, teachers and places of education have been deliberately targeted.

A report published earlier this year showed there had been 10,000 violent attacks on education, including the abduction of students in Nigeria by Boko Haram.