QUITO, Ecuador (AP) — Sixty-two inmates have died in riots at prisons in three cities in Ecuador as a result of fights between rival gangs and an escape attempt, authorities said Tuesday.

Prisons Director Edmundo Moncayo said in a news conference that 800 police offices have been helping to regain control of the facilities. Hundreds of officers from tactical units had been deployed since the clashes broke out late Monday.

Moncayo said that two groups were trying to gain “criminal leadership within the detention centers” and that the clashes were precipitated by a search for weapons carried out Monday by police officers.

Photographs and videos on social media show alleged inmates decapitated and dismembered amid pools of blood.

Deadly prison riots have happened relatively frequently in recent years in Ecuador, whose prisons were designed for some 27,000 inmates but house about 38,000.

President Lenín Moreno tweeted that he has ordered the Ministry of Defense “to exercise strict control of weapons, ammunition and explosives in the outer perimeters of prisons” as a result of this week’s riots.

Moncayo said 33 died at the prison in Cuenca in southern Ecuador, 21 in the Pacific coast city of Guayaquil and eight in the central city of Latacunga.

Moncayo said that close to 70% of the country’s prison population lives in the centers where the unrest occurred.

Minister of Government Patricio Pazmiño sent a tweet blaming “the concerted action of criminal organizations to generate violence in the country’s prisons," but added, "We are managing actions to regain control.”

Copyright 2021 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.