This underlines the challenge government has in fulfilling a pledge to stop gang violence.
Police in the city in Guanajuato State said the gunmen also wounded seven people in what was the second such attack to take place in Irapuato during the past month.
The attack was also confirmed by a federal government official.
Photos from the scene shared by Police with local reporters showed at least 11 prone and bloodied bodies lying in a room.
The attack was one of the worst mass slayings since President Andres Manuel Lopez Obrador took office 19 months ago pledging to reduce record levels of violence.
But homicides hit a new record last year and are trending higher still in 2020.
On June 6, ten men were killed when gunmen opened fire in a rehabilitation centre for addicts in Irapuato.
It was not immediately clear if the same facility was hit both times.
Guanajuato, a major car-making hub, has become one of the principal flashpoints of criminal violence in Mexico.
Rehab centres are known to have been targeted by criminal gangs waging turf wars for control of the drug business.
At least 26 people were killed in an arson attack by suspected gang members on a bar in the southern Mexican port of Coatzacoalcos last August.
AFP