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.
Image source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…