Mexico's national security spokesman Monte Alejandro Rubido said the 11 men and one woman were investigating crime in President Felipe Calderon's home state of Michoacan, which has been a center of his crackdown on organized crime.
They were ambushed by members of the La Familia drug cartel, Rubido said. Their bodies were found piled up along a mountain highway late Monday near the town of La Huacana.
Michoacan state prosecutor J. Jesus Montejano initially said Tuesday that they were soldiers, but the army denied that. His office later acknowledged the mistake.
Initial reports indicated the victims were likely killed over the weekend, when federal agents arrested Arnoldo Rueda Medina, a chief of operations of the Michoacan-based La Familia cartel.
Police say his arrest Saturday set off a string of brazen attacks against federal forces that left six federal police officers and two soldiers dead. Heavily armed gunmen threw grenades and fired on federal police stations and hotels where the agents were staying in three states.
"Without a doubt La Familia is known for its violence ... we shouldn't be surprised by their reaction," Rubido said.
Federal forces arrested politicians in several of those cities, including La Huacana, during an unprecedented sweep in May. Seven mayors, one former mayor and the state prosecutor remain jailed accused of protecting the La Familia cartel.
Since Calderon took office in December 2006, he has sent more than 45,000 troops to drug hot spots. More than 11,000 people have been killed in drug violence.
Michoacan has been wracked by a wave of killings and arrests in recent weeks.
On Tuesday, three bodies were found in the Michoacan town of Nuevo Urecho.