Forty-five students, among them young children, were discovered held in chains in a basement when police raided an Islamic seminary in Pakistan last night.
The male students, some said to be as young as 12 but appearing even younger, were found in what amounted to a dungeon at the Madrassa Zakarya in the Sohrab Goth district of Karachi.
Led barefoot from their prison, captives told officers they had suffered regular beatings and been hung upside down as a form of punishment.
Others said they had been visited by Taliban fighters and that 10 of their fellow students had disappeared in recent months.
One boy said that visiting Taliban members had told them to 'prepare for battle'. Some Pakistani madrassas have long been suspected of grooming Islamic militants.
Police arrested a cleric and two others at the scene, but the madrassa's administrator managed to escape during the raid, Pakistan's Express Tribune reported.
Local police Superintendent Rao Anwar told the paper: 'Those recovered are aged between 12 and 50 years and are mainly of Pakhtun ethnicity.
'A few drug addicts and mentally challenged persons were also among those who were recovered.'
'It seems that the administration was running a sort of religious school-cum-rehabilitation-centre and were receiving considerable sums of money from parents of those kept in for that purpose.'
Sanaa TV, a local station, showed footage of the raid and the chained students, who danced and cried as police began to free them.
'We were kept in chains and hung upside down and beaten with sticks if we didn't comply. We were told that we would be given training to fight in Afghanistan,' one boy said.
Another told how Taliban fighters had visited the seminary, led prayers and told them to prepare for battle.
The raid came after an anonymous tip-off to authorities. Police official Mukhtiar Khaskheli told Agence France-Presse that a full investigation would probe any possible links with militants.
'The madrassa officials claim that they had chained those students because they were drug addicts and they wanted to rehabilitate them and make them better Muslims,' he added.
According to the Press Trust of India, most of the captive students had been brought to Karachi from remote parts of Khyber Pakhtunkhawa province, a hotbed of Taliban activities.
'What we have learnt is that the parents used to pay the seminary for the education of their children who were sent to Karachi to get religious education,' a police official told the agency.
Pakistani government records seen by AFP suggest there are 15,148 seminaries in Pakistan, with more than two million students.
But officials suspect many more unregistered schools exist, providing the children of Pakistan's poverty-stricken majority with the only education they can afford.