A battle between groups of prisoners has left 13 inmates dead and another 65 injured, according to officials in the central Mexican state of San Luis Potosi.
The clash began when a group of inmates, fed up with harassment by other prisoners, used homemade knives and picks to attack their rivals starting at about 4:15am (0915 GMT) at the La Pila prison in the state capital, according to the state attorney general's office.
State police re-established control in the cell block where the fight broke out, according to a posting on the security ministry's official social media page.
Gabriela Gonzalez Chong, a spokesperson, called the violence a "fight, not an uprising" against prison authorities.
Fernando Toranzo, San Luis Potosi governor, said that 13 inmates had died and that 22 of the 65 injured were in serious condition.
Toranzo said officials would investigate whether prison authorities played a role in the clash.
The authorities were investigating the cause of the riot and it was unclear if inmates belonged to rival drug gangs, whose battles have caused havoc across Mexico.
Violent disputes between rival cartels and gangs often spill over into Mexico's prisons, where fights, riots and escapes are common.
The National Human Rights Commission reported in 2012 that prisoners, often linked to drug gangs, effectively run the interior of many Mexican prisons.
The Zetas drug gang has been especially active in San Luis Potosi in recent years.
Deadly riots have repeatedly rocked Mexico's overcrowded prisons, house inmates from different drug gangs
that have been fighting over trafficking routes and local turf.
Killings linked to organised crime fell 14 percent to 4,249 in the first four months of the presidency of Enrique Pena Nieto, who took over in December and vowed to reduce the violence that has marred Latin America's second biggest economy.
Former President Felipe Calderon sent the military out to fight drug cartels during his 2006-2012 term, when nearly 70,000 people died in battles and executions, and up to another 27,000 are missing, according to official data.