On a hill overlooking Istanbul is a religious school where, 50 years ago, a boy from a working class district attended classes in Islam. The boy was Tayyip Erdogan, Turkey's future president. The school was one of the first Imam Hatip schools, founded by the state to educate young men to be imams and preachers.

At the start of the 2017-2018 academic year in September, Erdogan returned to his old school, now renamed the Recep Tayyip Erdogan Anatolian Imam Hatip upper school after an $11 million redevelopment. He recalled the "tough days" of his childhood and the spirit in the school that drove its students to success.

"The joint goal of all education and our teaching system is to bring up good people with respect for their history, culture and values," Erdogan told flag-waving children at a ceremony to mark the reopening of the school.

Open gallery view The number of students attending Imam Hatip schools, where religious education lessons account for around a quarter to a third of the curriculum on average, has increased sharply since 2012 Credit: Reuters

Erdogan has said one of his goals is to forge a "pious generation" in predominantly Muslim Turkey "that will work for the construction of a new civilisation." His recent speeches have emphasised Turkey's Ottoman history and domestic achievements over Western ideas and influences. Reviving Imam Hatip, or Imam and Preacher, schools is part of Erdogan's drive to put religion at the heart of national life after decades of secular dominance, and his old school is just one beneficiary of a government programme to pump billions of dollars into religious education.

A Reuters review of government budget and investment plans shows that spending on Imam Hatip upper schools for boys and girls aged 14 to 18 will double to 6.57 billion lira ($1.68 billion) in 2018 - nearly a quarter of the total upper schools budget. Although the 645,000 Imam Hatip students make up only 11 percent of the total upper school population, they receive 23 percent of funding - double the spend per pupil at mainstream schools.

Since 2012, when Imam Hatip education was extended to middle schools for pupils aged 10 to 14, total pupil numbers have risen fivefold to 1.3 million students in over 4,000 schools. The government intends to complete construction of 128 Imam Hatip upper schools in 2018 and has plans to build a further 50, the budget and investment plans show. Turkey has also increased religious education teaching at regular state schools, some of which have been converted into Imam Hatip schools. The government declined to say how many.

But for all the extra cash they receive, the Islamic schools are underperforming the regular ones, key metrics show.

The education ministry didn't respond to questions about the expansion of Imam Hatip schools. Education Minister Ismet Yilmaz has said previously that the government is responding to popular demand by opening new Imam Hatip schools. "We are doing whatever our citizens say," he said at a ground-breaking ceremony for a school mosque in December.

An official in the president's office referred Reuters to Erdogan's public remarks on Imam Hatip schools and declined to comment further. A government adviser said, "Islam is not being forced on people. It is not a matter of saying everyone should go to Imam Hatips. We are just providing an opportunity to those families who want to send their children to Imam Hatips."

The expansion of religious education is unsettling some Turks. Interviews with two dozen parents, teachers and education officials point to deep divisions over the role of Islam in education. Some secularist parents say the Islamist school movement is robbing their children of resources and opportunity. Those differences are part of a wider disagreement between liberal and secular sections of society and Erdogan's support base of conservative, pious Turks.

It was that support base that swept Erdogan's Islamist-rooted Justice and Development Party, the AK Party, to power in 2002. Since then, critics have accused Erdogan of rolling back the secular state founded by Mustafa Kemal Ataturk in 1923 and weakening its pillars - the army, judiciary and media. Relations between NATO-member Turkey and its U.S. and European partners have become strained. Ankara's bid to join the European Union has stalled and Western countries have criticised Turkey over mass arrests that followed a failed military coup in July 2016.

Praise and protest

The new Recep Tayyip Erdogan Anatolian Imam Hatip school complex, its Islamic-style architecture rising in a historic district on the European side of Istanbul, is a source of pride for the parents of the 800 children who fill its classrooms and playground.

"God willing, all our schools will reach this standard and quality," said Kamber Cal, 45, a chemist. His 16-year-old son is delighted to attend the school, he said. "My daughter is now dreaming about going to Imam Hatip, the time when she will cover up and she will learn about the Koran and the Prophet's life."

In a mosque on the roof, boys listened to a preacher before Friday prayers when a Reuters reporter visited the school in October, while in the playground below, other boys played football. Some students perused books on shelves in the corridors. The school's website vaunts its success in pursuits including karate, biology, chemistry, Arabic, music and Koran recitation. Religious education lessons account for around a quarter to a third of the curriculum in Imam Hatip schools.

Cal and other advocates of Imam Hatip schools say parents want a strong moral education for their children. "If there is demand, it must be met. How high will this go? To 20, 25, 40 percent" of pupils? "Demand and society will decide," Cal said.

Such a prospect is anathema to secularists, people on the political left and members of the minority Alevi faith, which draws upon Shi'ite, Sufi and Anatolian folk traditions and rituals that differ sharply from those of the country's Sunni majority. Feray Aytekin Aydogan, chairwoman of the Egitim-Sen teachers' trade union and a critic of the expansion of Imam Hatip schools, said: "There is no need to give people religious education in order for them to get a profession."

Erdogan's redeveloped school stands as a paragon among religious schools. On the Asian side of the city, the crowded 60th Year Sarigazi middle school, established six decades after the founding of Turkey's secular republic, illustrates some challenges that the spread of Imam Hatip schools has presented. Sarigazi is a non-religious school, in an area with a strong Alevi and secular community, but a large part of the premises has been converted into an Imam Hatip school.

A group of parents has petitioned education authorities to stop the conversion, collecting hundreds of signatures. Those parents say the change began several years ago with a few Imam Hatip "guest" classes but has since expanded to 1,300 pupils, encroaching on the building where some 3,000 students study in a regular middle school. The mother of a 10-year-old girl at the regular school said she and other parents would continue their fight against the school's conversion. She said it was wrong to force Islam on people. Like several other secularist parents interviewed, the woman declined to give her name.

Parents complained that non-religious students at the 60th Year Sarigazi middle school get less support than Imam Hatip students and that their classes are more crowded, with an average 40 pupils in a classroom, compared with 30 on the Imam Hatip side. They say they have lost laboratory and art space. The mother of a boy at the school said her son asked, "Why is the Imam Hatip part of the school better?"

Reuters could not independently verify the parents' claims and the education ministry declined to comment. But in response to the parents' petition, education authorities said there were plans to build a new school in the area. It was unclear which students would move there.

Parents at the Sarigazi middle school claim success for another petition they filed in October to halt construction of a wall at one end of a playground. They saw the wall as an attempt to divide the school permanently. The local education authority said it had halted construction, without giving a reason.

A group of parents at another school - the Mahmut Kemal Inal middle school on the Asian side of Istanbul - failed in a campaign to prevent it being converted into an Imam Hatip. They picketed at the gates and organised protests and a petition signed by hundreds. It was to no avail. The only intake for the 2017-2018 academic year was of Imam Hatip students. "I am sad that we were ignored," said Fulya Yilmaz, whose 11-year-old daughter attends the school.

Education authorities said the local community wanted the school to become an Imam Hatip school. But Yilmaz said only 125 students had enrolled in September, a low intake. On average around 230 pupils normally study in each of the school's four year groups. The education authority declined to comment on enrolment details.

"Schools and morality"

Successive AK Party governments have given a high priority to education, ramping up the education ministry's spending to some 12.3 percent of the entire budget this year from 6.9 percent in 2003, the AK Party's first full year in power.

Despite all the money allocated to the schools, figures on 2017 university placements show graduates of religious schools lag their peers in regular schools. Only 18 percent of applicants from religious schools earned places on full degree courses at university last year, compared with 35 percent from regular state upper schools and 45 percent from private upper schools.

A survey of academic performance published in December 2016 for the Organisation for Economic Cooperation and Development showed the success of Imam Hatip upper school students was below the national average.

More broadly, Turkey slipped an average of eight places in the survey's rankings for science, mathematics and reading, compared with the previous study three years earlier, to 50th among 72 countries. That marked a reversal of the progress Turkey made in the previous two terms of AK Party government. It was also a setback for Erdogan, who hopes that driving up education standards will help achieve his target of making Turkey one of the world's 10 largest economies by 2023, the centenary of the founding of Ataturk's secular republic. Turkey is currently a member of the Group of 20 top global economies.

Reuters could not determine whether socioeconomic factors were contributing to the performance gap between Imam Hatip and regular schools because there is no data available on pupils' family backgrounds, their income and education. However, religious schools are found in towns and cities across Turkey, in poor and affluent districts.

While the number of Imam Hatip schools has surged in recent years, the number of students in Imam Hatip upper schools dipped slightly last year. Opposition lawmaker Engin Altay said the slide was "directly correlated with the low success rate of Imam Hatip upper schools in an academic sense." Education Ministry Undersecretary Yusuf Tekin said Imam Hatip upper schools had filled 84 percent of their quota for 2017-2018. Standard curriculum upper schools had exceeded theirs.

Advocates of Imam Hatip schools say the current expansion should be seen in the context of the previous suppression of these schools. They point to a crackdown in 1997 when Turkey's then powerful military pressured the first Islamist-led government out of power and forced the closure of most Imam Hatip establishments.

Muslims went out into the squares to defend their rights in protests. Businessman Hanefi Gundogan, 49, said he was unable to send his eldest son to an Imam Hatip school because of the crackdown, but now his youngest attends such a school.

"Muslims have now reached a point where they can breathe more easily in their own country," he said. "In the last 15 years this government has shown respect to Muslims."

Halit Bekiroglu, chairman of an association of Imam Hatip members and graduates, said secularist fears about the schools were exaggerated. Their revival, he said, reflected the conservative religious character of most of Turkish society and a desire for a change in an education system that previously imported Western ideas.

"Modernisation and Westernisation were not implemented healthily. They were implemented in a superficial, formalistic, harsh, copy-paste way. This was not in harmony with this country's sociology," he told Reuters in the association's offices, overlooking the huge dome of the 6th century Hagia Sophia.

Parents who send their children to Imam Hatip schools speak of their desire for them to have a strong moral education. It's a theme Erdogan stressed during his visit to his old school. "The school brought up children with such morality that they would not even pick fruit which hung from the apple tree hanging over the school walls," he said.

Whatever the origins of the Islamist education revival, critics are worried by it. Batuhan Aydagul, director of Education Reform Initiative, an independent think tank in Istanbul, said: "What we see now is a 'national and native' identity being constructed in education."

The most recent national curriculum, announced in July, excluded Charles Darwin's theory of evolution from science lessons. The government has also doubled religious teaching in regular schools to two hours per week. This compulsory teaching is a bone of contention for many secular Turks. Some have launched legal action to secure exemptions for their children.

One parent who did so successfully was mathematical engineer Ozlem Koc, 42, who lives on the Asian side of Istanbul. She won a court case in June after a year-long battle with education authorities to exempt her 10-year-old son from religious education, arguing that it was contrary to human rights to force it on children.

"This is not just my personal case," she said. "I want my child to be exempt from religious lessons, but I am also fighting for compulsory religious education to be removed from the curriculum."