At least 118 inmates died in rioting in an Ecuador jail this week before police regained control Thursday. Following the latest carnage, here is a look at the deadliest clashes in recent years in Latin America's notoriously overcrowded prisons.

Over the past three decades, there have been several massive prison riots that left more than 100 inmates dead.

In 2005, a fire ripped through an overcrowded prison in the Dominican Republic's eastern city of Higuey after a dawn riot, leaving at least 135 people dead.

In 1994, 121 inmates were killed after prisoners set fire to three prison blocks during a riot at Sabaneta prison in Venezuela's northern city of Maracaibo.

In 1992 in Brazil, 111 prisoners were killed when security forces put down a riot at the enormous Carandiru jail outside Sao Paulo.

The massacre was later portrayed in an acclaimed 2003 film, "Carandiru."

Tuesday's bloodshed in Guayaquil is believed to be linked to a "war" between Mexican drug gangs. It is the fifth major incident in the port city's prison in just over a year.

In all, some 200 inmates have died in violence in Ecuador's jails so far this year as they have become a battleground for thousands of prisoners with ties to powerful Mexican cartels.

More than 100 died in clashes last year -- with many beheaded -- with corruption allowing inmates to smuggle in arms and ammunition.

Ecuador's prison system has 65 facilities designed for about 30,000 inmates but a population of 39,000, watched over by 1,500 guards -- a shortfall of about 2,500, according to experts.

Inmates walk on the roof of a wing of the main regional prison in Guayaquil, Ecuador, where at least 24 prisoners were killed in a gun battle among inmates
Inmates walk on the roof of a wing of the main regional prison in Guayaquil, Ecuador, where at least 24 prisoners were killed in a gun battle among inmates AFP / Fernando Mendez

Deadly riots are frequent in Brazil's overcrowded prisons, which roughly hold twice the number of inmates they were built for.

With more than 702,000 prisoners, Brazil has the world's third largest prison population after China and the United States.

In late May 2019, at least 55 prisoners were killed in several jails over two days in the northwestern state of Amazonas.

Two months later 57 died in a battle between rival gangs in a prison in Altamira in northern Brazil.

On April 11, 2018, at least 21 died in an attempted breakout from a prison near the northern city of Belem.

In early 2017, deadly riots left around 100 prisoners dead in the space of a month -- many were decapitated and even disemboweled.

Venezuela also has a long and bloody history of prison unrest, almost matching Brazil's grisly record of 756 deaths since 1992.

In May 2020, 47 prisoners died after a riot sparked by food shortages in a jail in the western city of Guanare.

In May 2019, at least 29 prisoners were killed in clashes at a jail in the western town of Acarigua.

March 28, 2018 saw one of the worst prison riots in Venezuela, with 68 people dying in a blaze in a police station jail in the northern city of Valencia.

In August 2017, 37 were killed in a jailhouse in the southern Venezuelan state of Amazonas.