A survivor of the Nigerian "torture house" raided by police has described being there as "living in hellfire".
"If you are praying they will beat you. If you are studying they will beat you," Isa Ibrahim, 29, told the BBC.
Nearly 500 men and boys were rescued from the building in Kaduna, which was being used as an Islamic school and correctional facility.
The police said it was a place of human slavery, with many detainees found in chains.
Some of the victims had been tortured and sexually abused, the authorities say.
The BBC's Ishaq Khalid, who visited the building in northern Nigeria, says there are concerns that similar abuse may be occurring in other such institutions.
Many families in this mainly Muslim part of the country can't afford to send their children to school and those that can often enrol them in poorly regulated institutions like this one, he says.
A sign on the front of the building describes it as the Ahmad bin Hambal Centre for Islamic teachings but it was also used by some as a place to reform young men with behavioural problems.
Kaduna state police spokesman Yakubu Sabo said the "dehumanised treatment" they discovered made it impossible to consider it an Islamic school, Reuters news agency reports. It was not registered as either a school, or a correctional facility, although it did charge fees to parents.
Seven people, including some staff, have been arrested. The government says it will investigate other institutions which purport to provide Koranic studies.
There have been numerous reports of abuse at Koranic schools across northern Nigeria, with students sometimes forced to spend their days begging on the streets.
Isa Ibrahim's ordeal
Mr Ibrahim said he was sent to the centre two weeks ago by his family, apparently to "correct his behaviour".
He said he had tried to escape the day before the police arrived.
He described being chained up to an old generator and also being subjected to a particularly cruel punishment, known as "Tarkila", where his hands were tied up and he was left hanging from the ceiling.
"I have many injuries. Almost all parts of my body have injuries," he said. "Even if you are sleeping - they'll use [a] cane to wake you up."
He said he had been starved and was only given plain rice to eat. People kept at the centre "lose all of our energy", he added.
Children as young as five were among those rescued from the institution, which is believed to have been operating for several years. Most of the inmates were from northern Nigeria but two were reportedly from Burkina Faso.
Abandoned chains at a 'house of torture'
Ishaq Khalid, BBC News, Kaduna
The pink two-storey building is a prison-like structure surrounded by high walls and barbed wire. It has an imposing gate, with more than a dozen rooms, with small windows for ventilation.
When I visited, the compound was littered with abandoned household items like mattresses, buckets, clothes and books - apparently left in the wake of the police raid.
Kaduna state police spokesperson Yakubu Sabo told me most of the captives had been rescued with their shackles still on but I could still see some abandoned chains, as well as car wheels and petrol-powered generators to which the victims had allegedly been attached.
People living nearby have been left bewildered - some told me they couldn't believe the shocking discovery.
The "students" did not go to out to beg on the streets as is the usual practice with traditional Koranic schools in this region. Nor had they been forced to do hard labour - some said they had not seen the outside world for years.
Torture was used as a form of discipline - to correct perceived bad behaviour.
Relatives are being reunited with their children at a camp in Kaduna where the victims were taken after being rescued.
Some said they had been prevented from seeing their children at the school.
"If we had known that this thing was happening in the school, we wouldn't have sent our children. We sent them to be people but they ended up being maltreated," said a parent named Ibrahim, who had identified his son.
The Kaduna state government says it will now carry out checks on all Koranic schools across the state.
"This is an eye-opener for us," said Hafsat Baba, Kaduna State Commissioner of Human Services and Social Development. She added that if this scale of abuse was happening in the main city, she didn't know what might be going on in rural areas.
"We have to map all the schools. And we have to make sure that if they violate the government orders then they have to be closed down completely," she told the BBC.
"If we find any facility that is torturing children or is harbouring these kind of horrific situations that we have just seen, they are going to be prosecuted."
President Muhammadu Buhari has condemned reports of shocking abuse at the institution.
He also urged religious and traditional leaders to work with the authorities to "expose and stop all types of abuse that are widely known but ignored for many years by our communities".
Related story: Hundreds freed from torture house in Nigeria