A clash between rival gangs in a prison in Mexico's north-western state of Sinaloa has left 29 inmates dead.
The killings brought the number of dead on another day of apparent drug-related violence to more than 40.
In the western state of Michoacan, 12 police officers died in an ambush by suspected drug cartel gunmen.
Michoacan and Sinaloa are home to rival drug gangs that are fighting turf wars and battling security forces.
Officials said 18 inmates had died in the Mazatlan jail in Sinaloa when members of one gang armed with pistols and an assault rifle forced their way into a cell-block holding prisoners from a rival gang and began shooting.
Eleven others had been stabbed to death as fighting broke out in other parts of the prison, they said.
Two police officers and a prison guard were wounded as they tried to stop the violence. Police and soldiers later regained control of the prison.
Local media reports said some of the victims belonged to the Zetas drug gang, which has been fighting the Sinaloa cartel for control of smuggling routes.
The Sinaloa cartel is headed by Joaquin "Shorty" Guzman, Mexico's most wanted man.
Sinaloa state governor Jesus Aguilar warned last week of serious overcrowding at the prison, and asked that serious offenders be transferred.
Monday saw 15 police officers killed in clashes with suspected drug gang members.
Three officers were shot dead in the northern border state of Chihuahua when gunmen drew up alongside their two vehicles.
The ambush in Michoacan hit a federal police convoy as it was returning to Mexico City, officials said.
Gunmen blocked the road with trucks and machine-gunned the police vehicles outside a school in the town of Zitacuaro.
Police say they killed and wounded some of the attackers, who fled.
Michoacan - President Felipe Calderon's home state - is the base of La Familia.
Last year the drug gang was blamed for the murder of 12 federal agents, whose tortured bodies were dumped on a highway in Michoacan.
At least 23,000 people have been killed in drug-related violence in Mexico since December 2006, when President Calderon ordered the army and federal police to combat the cartels.
In an article published on the presidency website and also in several newspapers, Mr Calderon defended his strategy.
"I am convinced that we would be in a much worse situation if we had not decided to take on the criminals," Mr Calderon wrote.
"If we remain with our arms crossed, we will remain in the grip of organised crime, we will always live in fear, our children will have no future, there will be more violence and we will lose our freedom."
On Friday, nearly 40 people were killed in two separate attacks blamed on drugs gangs - one in Ciudad Juarez on the US border, the other in Ciudad Madero in north-eastern Tamaulipas state.