"These criminals carried out their executions as part of the settling of accounts between rival gangs and disgracefully these cowardly criminals then murdered innocent civilians on their way back to their cells," Najera said.
Dozens of people are believed to have been killed in three massacres in Torreon, an industrial city in northern Durango state close to Gomez Palacios, where the prison is located.
The deaths include 17 people shot dead at a party on July 18; 15 people killed inside a bar on May 18, and 10 people killed on February 1 in the same city.
The slayings are part of the relentless bloodletting among rival drug cartels that has been blamed for about 25,000 deaths since December 2006, when Felipe Calderon, the president of Mexico, launched a massive crackdown against drug crime and deployed 50,000 troops across the country.
The worsening violence has alarmed the United States and risks undermining investor confidence in Mexico, where the industrial sector depends heavily on export sales and foreign investment.