In classrooms facing a sandy courtyard in the northern Nigerian city of Kaduna, Maska Road Islamic School teaches a creed that condemns the violent ideology of groups like Boko Haram.
Not everyone has got its message. Umar Farouk Abdulmutallab, known as the "Pants Bomber", spent his youth in this school - and ended up trying unsuccessfully to blow up a U.S. airliner on Christmas Day 2009 with explosives hidden in his underwear.
But the school is steadfast in preaching tolerance to its pupils, and the government is about to adopt this message in a new strategy for containing Boko Haram, which has killed thousands in a five-year campaign for an Islamic state.
"We teach them that what they (Boko Haram) are doing is a total misunderstanding of the Islamic religion, that Prophet Mohammed was compassionate, he even lived together with the non-Muslims in Medina," said headmaster Sulaiman Saiki.
"We teach them tolerance," he told Reuters as girls in the next room softly recited Koranic verses in Arabic melodies.
Abdulmutallab was radicalized in an al Qaeda camp in Yemen, but his case shows that even youths given a relatively liberal Muslim education can be seduced by radical Islam. This is something the new government program is aiming to combat.
Koranic schools like Maska Road will be a pillar of the strategy being launched in September to counter Boko Haram's ideology. The aim is to win over the "hearts and minds" of young Nigerians.
They will also challenge Boko Haram's claim that secular teaching is "un-Islamic" - Boko Haram means "Western education is sinful" in Hausa, the dominant language in Nigeria's mainly Muslim north.
Maska Road teaches only Koranic verses and other tenets of Muslim faith, and encourages its 300 students to take classes such as science and literature outside its walls.
"We want them to get a Western education and combine it with ... religious learning," Saiki says. Classes are held between 4 and 6 p.m., after secular schools shut.
Fatah Abdul, who studies at Maska Road, scoffs at the idea of violence in the name of Islam.
"Our religion doesn't entertain killing. Boko Haram is absolutely different from what our religion advocates," she said. "And it's not true what they say that we need an Islamic state. The leadership doesn't have to be Islamic".
Saiki was a neighbour of Abdulmutallab when the future Pants Bomber was at school. He says Abdulmutallab didn't learn to hate the West there but "was deceived afterwards".
Abdulmutallab, a loner from a well-to-do northern family, showed how easily youths can be radicalized. Add poverty into the mix, as in Nigeria's troubled northeastern Borno state, and it's not hard to see how Boko Haram finds young recruits.
Boko Haram is suspected of being behind suicide bombings that killed 82 people in Kaduna last week, including one against a Muslim cleric about to lead a public prayer.
Kaduna, the capital of the north in colonial times, is richer than anywhere in the northeastern region where Boko Haram is based. But it shares many of its problems such as high youth unemployment, attested by the many children begging and hawking phone credit on its rubbish-filled streets.
President Goodluck Jonathan's administration has been pilloried for its apparent powerlessness to crush the rebels or protect civilians, including more than 200 schoolgirls kidnapped in April and who remain in captivity. But he has also faced censure for neglecting the insurgency's underlying causes.
So when Jonathan's National Security Adviser (NSA) Sambo Dasuki announced a new "soft approach to terrorism" in March, many instantly dismissed it as lacking in substance.
But officials in the office of the NSA say imams in mosques and traditional elders will be co-opted to preach tolerance, while measures will be taken to ensure Koranic schools teach "correct" interpretations of sacred texts.
The drive will also include educational programs, especially increased sports and music in northern schools, plus reform programs for convicted Boko Haram detainees.
"A lot them don't have much Islamic knowledge, so they tend to believe what the mullahs say," Fatima Akilu, director of behavioural analysis in the office of the NSA told Reuters. "We want to teach what the Koran actually says in a language they understand."
A parallel economic program, also funded by the NSA's budget, will address the chronic poverty seen as a major driver of the insurgency.
It may be too late to bring back hundreds of youths already fighting for Boko Haram, but the idea is to prevent more from joining.
Northern Nigeria has much lower levels of education than the south, a legacy of British colonialism, which protected the caliphates of the north from the activity of Christian missionaries who set up many schools in the south.
"The aspects of education Boko Haram don't like are the ones that allow you to think," Akilu said. "Keep people in the dark and you can control them with a singular narrative."
Undoing this partly involves showing how "Western" ideas, such as mathematics and some physics and astronomy, are rooted in mediaeval Islamic thought, which was making strides while Christians in Europe were busy burning witches.
At the Sultan Bello mosque in Kaduna's busy downtown market area, local imam Ahmed Gumi takes an unusual step to illustrate his openness to the non-Islamic world: he invites four Reuters journalists in to see, film and photograph his sermon.
Three are non-Muslim, including two Westerners. He introduces the team to his congregation of about 350 packed into a main hall, and after a chorus of "welcome" he offers a live interview about his views on Boko Haram in front of the faithful.
"It's not right to call what those boys are doing Islamic," he later told Reuters privately. "They hide behind Islam."
Gumi, one of northern Nigeria's most popular clerics, sees the idea of an Islamic state dear to extremists as a throwback.
"They want to bring back the golden age of Islamic triumph in this modern time." he says. "For a state to survive you need a strong civilization, education, money, lawyers, doctors. You don't create a civilization with AK-47s in the bush."
He knows his outspoken views carry a risk he'll be targeted by Boko Haram. His mosque, a towering structure spread between four sand-colored turrets with turquoise-green domes, is guarded by scores of unarmed volunteers checking cars and bags.
Boko Haram fighters have killed dozens of clerics. One of the targets of the Kaduna bombs was a Sheikh Dahiru Bauchi, an imam whose mystical Sufism is a far cry from the austere al Qaeda-style type of Islam. Bauchi survived.
Though a government critic, Gumi approves of the soft approach, "but it needs local Borno (leaders) more than people like us who are already openly opposed to them".
Taking issue with Boko Haram's ideology will work only if the government can draw disaffected youths away from the AK-47. The NSA's economic programme aims to do this, starting with 2 billion naira ($12.3 million), but with a further 60 billion that can be made available from other agencies for projects, said Soji Adelaja, NSA special adviser on economic intelligence.
They include mobile medical trucks, cash for the orphans and widows of Boko Haram's victims, and a programme employing 150,000 youths to fix roads and rebuild police stations.
Parts of Nigeria that are completely besieged by the insurgents are off-limits, but there are other vulnerable areas where the programme can be rolled out, Adelaja says. "We are deploying in areas that are safe, and where the community has some resilience against Boko Haram."
The death of Boko Haram's founder Mohammed Yusuf in police custody transformed what had been a clerical movement into an armed rebellion in 2009. Akilu says Yusuf disliked "Western" science which he saw as contradicting the Koran, especially evolutionary theory, the fact that the world is round and the process of evaporation, because "rain is a gift from God".
Getting schools to show how science and religion can co-exist, she says, is essential to combating such ideas.
Down a dirt track with crater-like potholes on the outskirts of Kaduna lies the iron-roofed Focus 1,2,3 International School. Twelve classrooms packed with desks take 25 children each.
Secular education is between 7.30 a.m. and midday. After lunch, Islamic schooling is between 1 p.m. and 5.30 p.m.
Muhammad Saleh, who runs the school, believes strongly in science, although he has doubts about evolutionary theory - as do many conservative Christians in the West.
Even so, his school teaches it. "I teach them evolution myself, and the parents never complain," he told Reuters. "It's education. Once children have an education they can decide for themselves what to think."