Security officials said the inmates had either forced or bribed a number of guards to open the doors between two separate wings of the jail.
A fight broke out between the prisoners, in which the killings occurred.
Deadly prison fights between rival gangs are not uncommon in Mexico: last month 31 inmates were killed in similar circumstances in Tamaulipas state.
Nuevo Leon state security spokesman Jorge Domene said inmates at the Apodaca prison had also set fire to mattresses and other flammable objects.
“Until now, we have counted 38 dead,” he said.
Jorge Domene said investigations were under way to establish the causes behind the fight, but that so far the evidence pointed towards a confrontation between rival gangs.
He said the security forces were now in control of the situation.
Relatives of the prisoners have gathered outside the prison, north of the city of Monterrey, to find out news about who has been killed and injured.
Jorge Domene asked them to be patient.
“We have more than 3,000 inmates in this jail and we have to account for all of them first,” he said.
Mexican jails are notorious for overcrowding, corruption and rioting.
In January, 31 inmates were killed at a prison in Altamira, in Tamaulipas state, when rival gangs confronted each other with homemade weapons and knives.
The US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…