MEXICO CITY - Gunmen killed 15 federal police officers yesterday in separate attacks in two drug-plagued states, marking one of the bloodiest days for security forces since the government stepped up its fight with drug cartels.

Twelve officers died in an ambush near a high school in the western state of Michoacan, while assailants killed three more officers in the northern border city of Ciudad Juarez.

The latest in a series of mass slayings came as President Felipe Calderon defended his crackdown on traffickers in an essay on his office's website. He vowed that he won't back down despite criticism that violence has only surged since he deployed thousands of troops and federal police in late 2006 seeking to crush the cartels.

"I'm clearly convinced that we would be in a much worse situation if we hadn't decided to fight criminals," Calderon wrote in the 5,000-word essay, which was published by several newspapers.

"If we remain with our arms crossed, we will remain in the hands of organized crime, we will always live in fear," the president said in the essay, which also blames Mexico's violence on the United States' voracious appetitive for illegal drugs.

In the ambush in Michoacan, Calderon's home state, officers riding in four pickup trucks were returning from a patrol when they came under fire in the city of Zitacuaro, the federal Public Safety Department said in a statement.

Ten officers died on the spot and two more on the way to a hospital. Thirteen other officers with wounds were taken to hospitals.

In a separate statement, the department said that gunmen killed three federal officers patrolling in Ciudad Juarez, a violence-plagued city across the border from El Paso, Texas. One officer was wounded, the statement said.

Nationwide, more than 22,700 people have been killed in drug violence since Calderon ordered the government offensive against cartels when he took office in December 2006.

Also, prosecutors said that 29 inmates have been killed in a prison riot in the northern Mexican state of Sinaloa.

A spokesman for the Sinaloa state prosecutors' office said that all the victims were shot to death. Investigators have found two pistols and an assault rifle in the prison in the Pacific coast city of Mazatlan.

Three police officers guarding the prison were wounded.