A prison melee in Mexico has left 31 people dead and another dozen injured in the state of Tamaulipas.

Federal forces had to surround Santa Amalia prison in the city of Altamira when inmates armed with makeshift knives, clubs and even stones stormed into a wing of the facility that they had been banned from and attacked the prisoners housed there, according to The Associated Press.

Many of those killed died from stab wounds, and others were bludgeoned to death by clubs.

Tamaulipas, which sits near the Texas border, has seen a significant spike in drug violence in the past two months, and the port of Altamira is used to traffic narcotics such as cocaine into the United States, as well as chemicals used for making methamphetamine into Mexico.

Local media outlets reported that the fight was between members of the Gulf Cartel and Los Zetas, both of which are active in the states of Tamaulipas, Veracruz and Nuevo León and regularly battle for territory.

State officials did not say if any other those involved in the fight were incarcerated for drug-related offenses, but did tell the AP that 22 of the deceased inmates had committed state crimes while the other nine were in for federal offenses.

Just a year earlier, four people were killed at Santa Amalia when an armed gang stormed into the prison to interfere with a prisoner transfer.

Prison fights are not uncommon in Mexico, where the combination of escalating drug crime and prison overcrowding create dangerous situations.

The Altamira prison was designed to hold 2,000 inmates, but was over-crowded by more than 1,000 additional prisoners when the fight erupted.

In October, 20 inmates at a prison in Matamoros, not far from Altamira, and another seven were killed at a prison in Monterrey. Three months before those incidents, 17 inmates were killed during a prison riot in Juarez, another city that is suffering from a drug-related crime wave.