Soldiers in Mexico have discovered 32 bodies and nine human heads in an area of the country where rival drug gangs are engaged in a wave of extortion, kidnappings and turf battles.

The 20 hidden graves were found at an outlaw camp near Zitlala in Guerro state, after residents reported an acrid smell and soldiers received a tip-off that people were being held at the site.

When soldiers went to the site on Tuesday they rescued a kidnap victim and discovered 12 bodies.

They returned on Thursday when further excavations uncovered the rest of the remains.

It is not known how long the remains had been buried for, and no arrests have so far been made.

Investigators are working to identify the bodies and the killers.

Roberto Alvarez, a spokesman for a security coordination group that includes members of Mexico's federal police, army and navy, said authorities would continue to search the area for more graves.

Residents of the nearby community of Tixtla found nine decapitated bodies on Monday beside a road, and prosecutors are investigating whether the nine heads found in Zitlala correspond to that gruesome discovery.

Cartels are battling over drug trafficking routes in Guerrero, which is one of the most violent states in Mexico.

The largely rural, impoverished state had 1,832 reported homicides in the first 10 months of 2016. If that rate continues unabated, Guerrero would be on track to have a homicide rate of about 60 per 100,000.

That would rival the recent peak year of violence in the state, in 2012, when there were about 68 homicides per 100,000 inhabitants.