MEXICO CITY — Gunmen killed 14 police officers Monday after ambushing a convoy, federal officials said, in a bloody setback to the Mexican government’s efforts to curb the country’s spiraling violence.

The attack, in a part of the state of Michoacán that drug gangs have battled over for decades, bore the hallmarks of the hyper-violent New Generation Jalisco Cartel, which has emerged in recent years as one of Mexico’s dominant organized crime groups.

It was a sharp reminder of the challenge facing President Andrés Manuel López Obrador, who had promised to tackle the violence racking the country, but may end his first year in office on Dec. 1 with Mexico having had a record number of killings.

Mr. López Obrador has argued that the best way to attack organized crime is to eliminate corruption and address the root causes of poverty. He has also created a national militarized police force, the National Guard, and deployed it in the country’s most violent regions.