The acting chief, Edgar Millán Gómez, was ambushed by several men wearing rubber gloves and carrying weapons as he entered his apartment building in the Guerrero neighborhood of Mexico City with two bodyguards at 2:30 a.m. He was hit eight times in the chest and once in a hand. He died a few hours later at Metropolitan Hospital.

Image Edgar Millan Gomez, the acting chief of Mexico's federal police, in January. Credit... Omar Torres/Agence France-Presse — Getty Images

Commander Millán was the highest ranking official to be killed since Mr. Calderón’s campaign against drug dealers began. Intelligence officials said it was highly likely that he was killed in retribution for the arrest on Jan. 21 of Alfredo Beltrán Leyva, one of the leaders of a cartel based in Sinaloa State.

“It was in response to his role in the arrest,” said one intelligence officer, speaking on the condition of anonymity because he was not authorized to release classified information. “It’s the worst casualty we have suffered so far.”

Commander Millán, 41, had served for the last year as the federal police official in charge of the antidrug operations throughout the country. A month ago, he was promoted to become the acting chief of the entire force.

His death was the 10th assassination of a federal police official in the last two months. Last week, gunmen also shot and killed the head of the organized crime division in the public security ministry, Roberto Velasco Bravo.