At least 56 inmates at a prison complex were killed in Brazil’s Amazonas state during a riot caused by rival drug gangs, which began on Sunday, Reuters reported on Monday. A total of 184 prisoners escaped during the violence at the Anisio Jobim complex, but around 40 were recaptured by Monday. A dozen security guards were taken hostage during the riot, but none were harmed.

Security chief for Amazonas Sergio Fontes said many of those killed were decapitated, with several bodies being thrown over the prison walls during the riot. Most of those killed were members of the Sao Paulo-based First Capital Command drug gang, he added.

Other officers said members of the gang were being targeted by the Manaus-based North Family, allegedly on the orders of Rio de Janeiro’s Red Command drug group. The violence was brought under control by security forces 17 hours after it began.

Fontes called the riot “the biggest massacre” ever committed at a prison in the state, according to BBC. “During the negotiations [to end the riot], the prisoners had almost no demands,” he said. “Their only request was to not be mistreated by the police when they came in.”

Several firearms and tunnels were found in the prison complex after the riot ended. Officers said another riot at a separate complex was quickly brought under control by security personnel.

Brazil’s penitentiary system has frequently been criticised by rights groups for overcrowding and excessive violence. The Anisio Jobim complex currently houses 2,230 inmates, despite having a capacity for only 590. The director of Pastoral Carceraria, a Catholic centre monitoring prison conditions, said such massacres were a daily occurrence in the country. “Our prisons were built to annihilate, torture and kill.”

The riot took place a week after Brazilian President Michel Temer announced a $366 million (approximately Rs 2,494.83 crore) package for states to improve prison infrastructure.