Gunmen have attacked a drug rehabilitation centre in central Mexico, killing at least 24 people and leaving seven wounded, local authorities said.

According to preliminary information, the attackers "entered the scene, forced (the victims) onto the ground and shot them," the secretary of public security in Irapuato, located northwest of Mexico City in Guanajuato state.

"We have reports that the (armed) subjects arrived in a red vehicle, no further information is known. The preliminary report we have is of 24 dead people and seven wounded," he added.

Authorities are working on locating the vehicle, he said.

The city of Irapuato said in a statement that three of the wounded were in serious condition, but that no one had been kidnapped during the attack. 

The state of Guanajuato, home to major industry and a number of large auto manufacturing plants, is plagued by organised crime violence.

The state's wealth has attracted groups such as the powerful Jalisco New Generation and Santa Rosa de Lima drug cartels, which are also involved in extortion, kidnapping and fuel theft.

Guanajuato's governor gave his condolences on Twitter and stated that "coordinated intervention by federal and state authorities is necessary as the only way to successfully confront this situation."

On 21 June Mexican authorities announced the arrest of 26 alleged members of Santa Rosa de Lima gang after burning vehicles were used as road blocks in the cities of Celaya, Salamanca and Villagran.

Following the violent episode President Andres Manuel Lopez Obrador said that his government would not allow the country "to fall into anarchy and disorder."

Just days before, six members of a family, including a minor, were reported murdered in Celaya.