Islamabad, Pakistan - Millions of pounds of UK aid are being used to steer students in Pakistan away from radical religious schools and into mainstream education.
British aid to Pakistan has doubled to a record £480m over the next three years as part of the world's Millennium Development Goals to reduce poverty.
Some £250m of that is being used to boost mainstream education, including at religious schools, or madrassas.
A representative for the madrassas said the cash would help modernise teaching.
Although the UK's Pakistan Country Assistance Plan is separate from the two countries' counter-terrorism co-operation, the indirect effect is to steer students away from certain madrassas where they are at risk of being recruited by violent extremists.
'Contemporary subjects'
The chairman of Pakistan's Board of Madrassas, Wakil Khan, said British aid money was needed to pay up to 80,000 teachers working to a contemporary syllabus, as part of an ongoing programme to reform the country's estimated 15,000 madrassas.
He said the reforms were taking place in three stages.
Firstly, all the country's madrassas are being registered, with 9,400 so far officially contacting the government.
Secondly, the syllabus is being nationalised by introducing contemporary subjects.
Thirdly, madrassas are being made part of the mainstream education system. They will use computer hardware and software, with those leaving at the end of their studies eligible for further education.
Many Muslims say madrassas have acquired an undeserved reputation for extremism after it emerged that one of the four London bombers, Shehzad Tanweer, attended one prior to blowing himself and others up in 2005.
Only a small minority of these religious schools are thought to preach a violent intolerance of non-Muslims and Mr Khan said the more radical ones were concentrated in the tribal territories and in Baluchistan in south-west Pakistan.
He also said some of those attending there had finished their studies and were just using the madrassa as a place to live.
He stressed that the vast majority of Pakistan's madrassas were working for a good cause.