The warden, superintendent and a guard have been arrested on murder charges following a prison riot in northern Mexico that killed 49 people, state prosecutors said Saturday.

On Friday, Nuevo Leon prosecutors had said that three state officers had been charged with murder in connection to the riot, but did not identify them by name or position. The two prison officials were also charged with abuse of authority.

On Thursday, rival factions of the Zetas drug cartel slaughtered each other inside the Topo Chico prison. The guard who was charged with murder fired on an inmate and killed him, prosecutors said.

State prosecutor Roberto Flores said prison director Gregoria Salazar Robles and superintendent Jesus Fernando Dominguez Jaramillo were charged for not maintaining the necessary security measures inside the prison. Investigators determined inmates had bats and metal bars that were used in the bloodbath. Some cells did not have locks and inmates were out and about at times they should not have been.

Many prisons in Mexico are under the control of the inmates.

On Friday, Flores said that four of the nine bodies still unidentified could not be named because the prison had no record of them at the facility. The other five bodies were badly burned and were awaiting DNA testing.

"It is a pretty irregular situation," he said of the violence in the prison in Monterrey, which is Mexico's northern industrial hub.

Authorities said the hours-long fight that raged into Thursday morning was a battle between rival drug gang factions that underlined the power that cartels wield inside many of the country's prisons.

Nuevo Leon Gov. Jaime Rodriguez said 60 hammers, 86 knives and 120 shivs were used in the bloodbath in which 49 inmates were hacked, beaten or burned to death and a dozen were injured.

At least 40 of the victims "died from wounds from stabbing and cutting weapons, blows from hammers and clubs," Rodriguez said at a news conference

"What we have to see as a reality in the entire penitentiary system is that there is self-rule" by the inmates, Rodriguez said. "All this corruption inside the prison creates the conditions we have today."

He acknowledged that prisoners effectively lord over the facility and that there were not enough guards watching them. "Nobody wants to be a guard," he said, because of the meager pay.

Before flying from Cuba to Mexico on Friday, Pope Francis sent a message to Monterrey's archbishop expressing profound sorrow for the victims. He also asked that his condolences be conveyed to the victims' families and wished a speedy recovery for those injured in the melee.

About half the inmates at Topo Chico have been sentenced for minor offenses or are suspects still awaiting trial. Nevertheless they are housed in the prison's overcrowded general population alongside many of the country's most hardened killers.

One of them was Raymundo Gonzalez Hernandez, a 23-year-old who is accused of kidnapping but whose trial is still pending. He was not among those listed as wounded during the riot, but his cousin said he was covered by bruises and welts when she was allowed inside to see him.

"Both his eyes were practically closed from all the hits they gave him," Cynthia Hernandez said.

"He couldn't even speak, he just went like this," she added, moving her head from side to side.

No escapes were reported in the clash, which took place on the eve of Francis' arrival in Mexico, a visit that is scheduled to include a trip next week to another prison in the border city of Ciudad Juarez.

Flores confirmed the clash was between two gangs led by two members of the infamous Zetas drug cartel, Juan Pedro Zaldivar Farias, also known as "Z-27," and Jorge Ivan Hernandez Cantu.

Rodriguez blamed the violence on "the old, outdated, obsolete system" under which Mexican prisons are run and suggested after having visited the United States that his country may have to move to U.S.-style, privately operated prisons.

"We have to think about efforts with private initiative," he said. "We have not been doing rehabilitation work."

He also criticized judicial reforms that have given inmates greater ability to appeal transfer orders that could send them farther from their hometowns. Zaldivar had successfully fought to be moved to Topo Chico, while Hernandez won an appeal against transferring him elsewhere.

"Basically this is creating the conflicts in the prisons," Rodriguez said.

___

Associated Press writer Mark Stevenson contributed to this report.