Ten other federal agents were wounded in the ambushes.
Convoys of heavily armed gunmen tossed grenades and opened fire on police stations in the state capital of Morelia and in five other cities between 5 a.m. and 9 a.m. Saturday. Assailants also shot up a hotel where federal agents were staying in Apatzingan, according to the state attorney general's office.
The attacks were among the boldest frontal offenses carried out against the government. They appeared to be in retaliation for the arrest of Arnoldo Rueda Medina, an alleged member of La Familia drug cartel, which is based in Michoacan.
Rueda was allegedly in charge of operations under reputed La Familia leaders Nazario Moreno Gonzalez and Jose de Jesus Mendez Vargas, who are both on Mexico's most-wanted list of drug suspects, said federal police coordinator Gen. Rodolfo Cruz.
Rueda was captured in Morelia before 5 a.m. on Saturday. Minutes later, a group of more than two dozen hit men tossed fragmentation grenades and opened fire on federal police offices where Rueda was being held.
Three agents were injured in the grenade attacks before officers were able to fend off the aggressors, Cruz said.
The violence then spread across the picturesque Pacific coast state.
In Zitacuaro, a mountain town famous for its Monarch butterfly nesting grounds, three federal agents were killed Saturday, and two soldiers were fatally shot in the town of Zamora. Other officers were wounded in attacks in Apatzingan, Patzcuaro, and Huetamo.
Two federal agents were killed and three others were wounded along a highway between Morelia and the port City of Lazaro Cardenas on Saturday afternoon when dozens of gunmen ambushed their patrol cars, according to the state attorney general's office.
Many of Saturday's attacks occurred in towns where federal forces arrested mayors in May in an unprecedented sweep against politicians accused of protecting cartels. Eight mayors remain jailed on organized-crime charges.
President Felipe Calderon's home state of Michoacan has been at the center of his drug war. Calderon has sent more than 45,000 troops to the state and other drug hotspots throughout the nation, and gangs have responded with unprecedented bloodshed.
Drug violence has killed more than 11,000 people nationwide since 2006, when Calderon took office.
By GUSTAVO RUIZ