A number of inmates have died with some reportedly beheaded and dismembered after a prison riot in Ecuador this week. Authorities managed to control the facilities in three cities after raids by hundreds of police officers and military personnel.

This marks one of the deadliest outbreaks of prison violence in the country's history. Fights broke out in the maximum-security wing as rival gangs' power struggled within the detention centers, according to a Sky News report.

Prisons Director Edmundo Moncayo said in a news conference that 800 police officers have been helping to regain control of the facilities, with hundreds of officers from tactical units had been deployed.

Moncayo said that close to 70 percent of the country's prison population lives in the centers where the unrest occurred, according to an NBC News report.

"The concerted action of criminal organizations to generate violence in the country's prisons," Minister of Government Patricio Pazmiño was quoted in a report.

Pazmiño said they are managing to take back control in the prison.

Authorities have said that the fight began on Monday night, which was triggered by weapons searches. The national agency responsible for the upkeeping of the prisons said that at least 79 inmates had died, which includes 37 inmates in the Pacific coast city of Guayaquil.

Meanwhile, around 34 were from the southern city of Cuenca, and eight in the central city of Latacunga. The maximum-security prison area holds inmates connected to killings, drug trafficking, extortion, and other major crimes.

Related story: Ecuador, Colombia & More: Unwrapping Latin America's Gift-Giving Etiquette

Gang Wars

Moncayo said that the tension had been running high since the killing of Jorge Luis Zambrano in December. Zambrano is the leader of the Choneros gang, according to a BBC report.

Zambrano was shot dead in a cafeteria just months after being released from jail. He and his gang were known to have run lucrative smuggling, drug dealing, and extortion ring, which mainly operates inside Ecuador's jails.

Security analyst Ricardo Camacho said that there is a dispute between national gangs that seek to monopolize the power that was left vacant in the prison by Zambrano's death.

Camacho said that has given way to this massacre with violence never seen before.

"There are prisoners beheaded, dismembered, their hearts removed," Camacho was quoted in a report.

He added that when the police arrived, the prisoners did not put up much resistance as they had the time to do what they wanted.

The ombudsman's office said that 103 inmates were killed in prisons last year.

President Lenin Moreno has ordered the defense ministry to exercise strict control of ammunition of arms, munitions, and explosives at the country's prison.

Last year, he declared a 90-day state of emergency in the country's jail to try to bring gang activity under control and reduce the violence, according to a Malay Mail report.

Meanwhile, the government cut sentences of people convicted of minor offenses, reducing overcrowding from 42 percent to 32 percent. Ecuador's prison system has a capacity to house 29,000 with a population of 38,000.

Related story: Ex-Con Shot 15 Minutes After Being Released From New York Prison