A FTER HIS victory in the battle of Badr in 624, the Prophet released the prisoners he had taken, on condition that they teach others to read. That, says Muhammed Asghar Saqib, principal of the Jamia Ghousia Rizvia madrassa attached to the mosque in Lahore’s main market, is a measure of Islam’s respect for education. But, he goes on, “there is a misconception in our society about the purpose of education. Education is not for getting rich. Education is for becoming a better person.”

In some countries, such as America, religion is banned from schools. A growing appetite for religious education is one of the drivers of the growth of the private sector: in America, enrolment in religious schools among 4- to 14-year-olds increased from 4m in 2011-12 to 4.4m in 2015-16. And even where government schools teach religion, as in Pakistan, parents sometimes want more of it than is on offer in the state sector.

More than 2m Pakistani children attend madrassas, which troubles some of their compatriots for a couple of reasons. There are concerns that these schools serve as breeding-grounds for terrorism. Some are said to be financed by fundamentalists in the Gulf, but Mr Saqib says that his school, which is free to pupils, is paid for by the rents of 40 neighbouring shops which the mosque owns. There are also reasons to doubt the educational value of spending hours memorising the Koran. Mr Saqib is careful to emphasise that he believes in the value of both religious education—which the 300 boys at the school receive in the morning—and “contemporary” education, which they get in the afternoon.

Aside from some dusty computers in one room, there is little evidence of the contemporary. The classrooms have no desks or chairs, just tilted stands, a few inches high, on which squatting boys place their books. The dormitories have no beds, only bedding rolls laid out close together. In the kitchen a stack of firewood sits ready for cooking dinner. “Gas problem,” says Mr Saqib.

But there are spiritual if not physical comforts. Fifteen-year-old Ghulam Hassan from Layyah, a desert region of western Punjab where jobs are hard to come by, is learning to be a Koranic reciter. Offering to perform for the visitor, he intones verses from the Sura Yusuf, which tells the story of Joseph and his brothers. It is more a song than a recitation, and exquisitely beautiful.