Nearly 500 men and boys have been rescued from a building in the northern city of Kaduna, where the detainees were allegedly sexually abused and tortured, Nigerian police said.
Children as young as five were among those in chains at what was thought to be an Islamic school, officers said.
Kaduna police chief Ali Janga told that the building was raided after a tip-off about suspicious activity.
He described it as a “house of torture” and a place of human slavery.
Eight suspects, most of them teachers, were arrested. The police chief said the detainees – some with injuries and starved of food – were overjoyed to be freed.
The detainees said they had been tortured, sexually abused, starved and prevented from leaving – in some cases for several years.
Some of the children told police that their relatives had taken them there, believing the building to be a Quranic school.
Two of the children freed by police said their parents had sent them from Burkina Faso. Police believe the rest are mostly from northern Nigeria.