Authorities detained three alleged members of the Knights Templar drug cartel in the killing of one of Mexico’s highest-ranking navy officers and a bodyguard, Attorney General Jesus Murillo Karam said Monday.

President Enrique Pena Nieto vowed the attack wouldn’t go unpunished. “We will work with all speed to arrest and bring to justice everyone responsible for the death of Vice Adm. Carlos Miguel Salazar,” he said.

The killings of the admiral and another naval officer serving as his bodyguard marked a rare attack on Mexico’s top military brass, but appeared to have been the result of a series of tragic coincidences rather than a planned, targeted assassination.

Still, the shooting on a rural road in the western state of Michoacan showed just how out of control the state has become as the government offensive against crime gangs runs up against resistance from the Knights Templar cartel.

Salazar, his wife, driver and bodyguard were returning from a visit to the admiral’s family in the Mexico City area, when they ran into a protest that had closed the main highway leading back to the naval station he commanded on the Pacific coast, near the resort of Puerto Vallarta.

Seeing the protest, the admiral apparently made a tragic mistake. Rather than waiting for the road to reopen, as dozens of other vehicles did for about two more hours, or turning around and heading back to the nearest city to catch an airline flight, he had his driver head down a rural two-lane road in search of a shortcut.

“He decided to take an alternative route, to get back to his job on time, and he took a secondary road for that purpose,” Murillo Karam said.

But Michoacan has become a hotbed of cartel violence, with at least a half dozen ambushes of federal police convoys last week. And the highway blockage wasn’t just any protest.

A reporter for a Michoacan newspaper saw the protesters, mainly taxi and bus drivers, holding signs saying “Get out, Federales” and “We demand federal forces get out of Michoacan.” Such protests have frequently been organized by the Knights Templar cartel, which has often forced or paid residents to take part.

Federal security spokesman Eduardo Sanchez said it seemed unlikely the protest could have been organized just to interrupt the admiral’s travel. Rather, it appeared a response to the two-month-old government buildup of army and federal police in Michoacan after a series of towns rose up in arms and formed self-defense groups to fight off pervasive abuses and extortion demands by the Knights Templar.

Salazar’s SUV had navy logos, but inexplicably was not bulletproof. Neither he nor his bodyguard was in uniform.

Murillo Karam said one vehicle cut off Salazar’s SUV, forcing his driver to stop. A second vehicle full of armed men then drove up and opened fire. Salazar pushed his wife to the floor of the SUV and she escaped with only minor injuries, but the driver was severely wounded.

Murillo Karam said that the three suspects were detained in one of the vehicles used in the attack and that they had admitted belonging to the Knights Templar and taking part in the attack. He quoted the suspects as saying the cartel paid them 7,500 pesos a month (about $600) to steal, kidnap and extort money from people.

The navy has not been as heavily involved in the anti-drug fight in Michoacan as it has been in other states.