The officials had also allegedly provided protection to members of the cartel.
Hundreds of federal agents forced their way into the state attorney general's office in Morelia to detain three of the officials.
Most of the other mayors and officials detained were from other towns in a mountainous region where officials had recently found 22 methamphetamine laboratories.
There had also been a series of beheadings in the same region where the remaining mayors were arrested.
Among the detainees was the mayor of Uruapan, where La Familia gunmen dropped five human heads on the dance floor of a bar in 2006, the attorney general's office said in a statement.
The mayors came from parties across the political spectrum, including the conservative National Action Party, the party of Felipe Calderon, the Mexican president.
Several high-ranking state police officials and two municipal police chiefs were among those detained, including Citlalli Fernandez, the state governor's advisor, who also served as public safety secretary, the attorney general's office said.
Mexico's federal government has arrested many police officers on corruption charges in the past, but these arrests mark the first time the government has arrested such a large group of high officials.
The arrests indicate the extent of the influence drug cartels have in rural Mexico.
They also show how deep the cartel's influence runs in Mexico's political system, Victor Clark, director of the Binational Center for Human Rights in Tijuana, said.
"This is a huge blow to the cartels. These ties are indispensable for the operation of these organisations," he said.
"But until now the government has never dared to touch the political classes tied to drug trafficking."
Calderon launched his army-led nationwide crackdown on organised crime in 2006.
Nearly 45,000 troops and federal police have been deployed across Mexico to assist in the fight against drug, including in the sparsely inhabited mountainous region where drug plantations and laboratories are often hidden.
Since the crackdown began, more than 10,750 people have died as a result of drug violence with 6,300 drug-related murders in 2008 alone.
Mexican officials and local police are frequently bribed or threatened by well-armed gangs into facilitating the movement of billions of dollars of narcotics from Mexico into the US every year.
Barack Obama, the US president, praised Calderon's efforts in a visit to Mexico in April as other US officials said that the escalating violence in Mexico is a sign that the drug gangs are now weaker than they once were.