MEXICO CITY, Oct 6 (Reuters) - Unidentified gunmen killed 18 people, including a mayor, on Wednesday when they opened fire in a town hall in the gang violence-plagued southwestern state of Guerrero, authorities said.

Among those shot dead in San Miguel Totolapan were Mayor Conrado Mendoza, his father and former Mayor Juan Mendoza, and other local officials, according to a statement from the state of Guerrero. Two other people were wounded, it added.

Deputy Security Minister Ricardo Mejia suggested on Thursday the violence stemmed from a dispute between rival gangs, La Familia Michoacana and Los Tequileros.

Speaking at a regular government news conference, he said an operation was being carried out to find the perpetrators, and investigators were verifying a video in which Los Tequileros appear to claim responsibility for the killings.

Mexican daily El Universal had reported earlier that the gunmen appeared to have carried out a coordinated series of attacks inside the building with the aim of killing the mayor.

Meanwhile, in the central state of Morelos, state lawmaker Gabriela Marin was shot dead and her bodyguard wounded outside a pharmacy late on Wednesday, Mejia said. (Reporting by Juby Babu in Bengaluru, John Stonestreet in London and Sarah Morland in Mexico City; Editing by Peter Graff and Jonathan Oatis)