Mexico's President Andres Manuel Lopez Obrador on Thursday condemned an attack on a drug rehabilitation center that left 24 people dead.

Authorities said gunmen entered the center in the city of Irapuato in the central Guanajuato state on Wednesday, forcing victims "onto the ground and shot them."

"It's a very serious situation that Guanajuato is suffering," said Lopez Obrador during his morning press conference.

"There's a confrontation between (criminal) gangs and most of the time these are attacks between them."

It was the deadliest such attack this year, which also left seven people wounded, three critically.

The president called on the Guanajuato government, which is in opposition hands, to investigate whether the violence could be partly due to "conspiracy" between local authorities and criminal gangs.

A woman collapses near the drug rehabilitation center where 24 people were killed in Irapuato, Guanajuato state, Mexico, on July 1, 2020 A woman collapses near the drug rehabilitation center where 24 people were killed in Irapuato, Guanajuato state, Mexico, on July 1, 2020 Photo: AFP / MARIO ARMAS

Guanajuato's governor, Diego Sinhue from the conservative National Action Party, was meeting with his security cabinet on Thursday.

The presence of large scale energy infrastructure in Guanajuato has attracted criminal gangs such as the Santa Rosa de Lima cartel, which deals in stolen fuel and is battling the powerful Jalisco New Generation cartel for control of the lucrative trade.

On June 21, authorities said they had captured 26 suspected members of the Santa Rosa de Lima cartel, which responded by setting up blockades of burning vehicles in three cities.

Several days earlier six members of the same family, including one minor, had been murdered in the city of Celaya, one of those where the gang set up road blocks.

Wednesday's attack was the second most lethal assault since Lopez Obrador came to power in December 2018, after 28 people were killed at a bar in the eastern state of Veracruz last August.

Since December 2006 when the then-government launched a military operation against drug trafficking criminal gangs, more than 290,000 people have been murdered, according to official figures.