Syrian refugee students attend school in Taanayel, Lebanon. (Hassan Ammar/Associated Press)

Gordon Brown, prime minister of Britain from 2007 to 2010, is a U.N. special envoy for global education.

In Beirut — the troubled capital of a country with one of the worst histories of sectarian violence in the world — a unique experiment is underway.

Born out of a National Charter for Education on Living Together in Lebanon — which leaders of all major religions have signed — a common school curriculum on shared values is being taught in primary and secondary schools to Shiite, Sunni and Christian pupils.

The curriculum focuses on “the promotion of coexistence” by embracing “inclusive citizenship” and “religious diversity” and aims to ensure what the instigators call “liberation from the risks of . . . sectarianism.” But the new curriculum is more than an optimistic plea to love thy neighbor and an assertion of a golden rule common to all religions. It teaches pupils that they can celebrate differences without threatening coexistence.

The curriculum is designed for children starting at age 9 and includes four modules. The first tells the story of the global human family, asserting that all are equal in dignity. The second focuses on the rights and duties of citizenship, irrespective of religious or ethnic background. The third covers religious diversity, including the “refusal of any radicalism and religious or sectarian seclusion.” In the fourth, the emphasis shifts from the local to the need for global cultural diversity.

Of course, there is a long way to go before this experiment bears fruit, but the fact that it is happening today in Lebanon is of global significance because of the country’s decision to offer schooling to all Syrian refugee children.

Operating under a double-shift system — Lebanese children are taught in the morning, Syrian refugees in the afternoon — the public schools now house more refugee pupils — nearly 200,000 Syrian boys and girls — than local ones.

Lebanon’s offer of school takes young people off the streets and ensures that they are being taught in an ordered environment. More important, the curriculum’s focus on peace and reconciliation between religions is an antidote to the extremist propaganda of the Islamic State. The curriculum challenges the narrative of the violent extremists that there is an irreconcilable divide between Muslim believers and the apostate “others.”

The strategy of the Islamic State is to “capture the rebelliousness of youth, their energy and idealism, and their readiness for self-sacrifice,” according to its own propaganda. Central to this worldview, as one former hostage held by young Islamic State extremists bore witness, is “the belief that communities cannot live together with Muslims” and “that there is a kind of apocalyptic process under way that will lead to a confrontation between an army of Muslims from all over the world and non-Muslims.”

But if most Syrian refugee children are getting an education that promotes decent, humane values, the space this apocalyptic worldview holds rapidly diminishes.

President Obama is right to say that the Islamic State has to be destroyed as we also condemn those whose perverted interpretation of Islam leads them to condone violence. But hard power deals best with the hard core. We have to offer these young people an alternative vision of their region’s future and accept that there has been an abject failure in education. This has left too many Arab youth with little knowledge of the common strands within the world’s religions and of any alternative other than in jihad to closed and unreformed institutions that are unable to provide jobs or hope.

Today, 47 percent of Middle Eastern and North African youth are either unemployed or underemployed. By 2025, the region will be home to 250 million people under 25. With these young people under daily pressure to identify with the suffering of their fellow Muslims, we have to show that there is a third way beyond terror and an often tyrannical status quo.

All evidence suggests that if there were educational, employment and entrepreneurial opportunities, the region’s youth would seize them. Most want to live in a more open society with the chance to benefit from scientific advances like other young people. In a recent survey, nearly 40 percent of Middle Eastern youth said they wanted to start their own businesses.

It is time to show we are not only on the side of openness, tolerance and diversity but also of opportunity. We need to guarantee that every refugee child has what the 1948 Universal Declaration of Human Rights, the 1989 Convention on the Rights of the Child and the 2000 Millennium Development Goals promised: the right to education irrespective of where the children are located, what religion they practice or what status they have — refugee or otherwise.

Before the civil war, most Syrian children were in school. Now, with most of the 2 million Syrian children exiles on the streets, theirs is a lost generation among whom child marriage rates have doubled in Jordan and for whom child labor — according to recent survey of Turkish refugees — is rampant.

In just a few months, thanks to Lebanese Education Minister Elias Bou Saab, 175,000 refugee school places have been created without having to build one new school. But it is not enough. There are 200,000 school-age children still on the streets of Lebanon and even more in Turkey and Jordan.

But a lack of money is holding us back. For about $500 million, or $500 per year per student, we could put 1 million refugee children into school across Turkey, Jordan and Lebanon.

If education is available within the region, many parents will think twice about life-threatening voyages across the Mediterranean, and we will slow the exodus to Europe of thousands of refugee families. But the case for large-scale Western financial support for an education program in refugee communities is more compelling than that: It is about how we not only deal with the terrible suffering and sorrow of millions who have lost everything in a brutal civil war, but also offer a vision of a future that makes coexistence between religions a reality.