MEXICO CITY — Nine people were killed and one wounded when gunmen opened fire at a wake the central Mexican state of Guanajuato, officials said.

Public safety officials in the city of Celaya said in a statement the gunmen arrived late Thursday night and opened fire on a group of people. The victims were standing outside a home in a low-income neighborhood where a wake was being held for a young man who himself had been gunned down nearby a couple of days before.

Images from the scene showed bodies strewn in the street.

Guanajuato-based security analyst David Saucedo said the attack appears to have been carried out by the Jalisco New Generation Cartel against the dead man's family. The killers apparently believed they were linked to the rival Santa Rosa de Lima gang, even though many may not have been.

"At that wake, a lot of innocent people died," Saucedo said.

Guanajuato is at the center of the bloody turf war between drug cartels acting through local gangs. State authorities did not immediately confirm which gang was responsible for the killings. Thousands have been killed in Guanajuato since Santa Rosa de Lima, a local gang, began a turf war to fight off a takeover by the insurgent Jalisco cartel in 2017.

Authorities captured the leader of the Santa Rosa de Lima gang in August, but the violence has continued. Saucedo said that the Sinaloa cartel has apparently entered into a kind of proxy war to prevent a Jalisco victory in the state, sending arms, money and hired killers to support Santa Rosa de Lima and other local gangs. That same kind of proxy war made the border city of Ciudad Juárez a killing ground in the years around 2010.

The Santa Rosa gang grew up in a farming hamlet of the same name by stealing fuel from government pipelines and refineries and robbing freight from trains. But after authorities stepped up security around trains and pipelines over the last two years, the gang turned to extortion and kidnapping.

The Jalisco New Generation cartel has been Mexico's most violent in recent years, aggressively expanding its reach across the country through bold attacks against its rivals and government forces.

Their conflict has made Guanajuato — home to charming San Miguel Allende, a popular retirement spot for Americans — Mexico's deadliest state.

In September, gunmen killed 11 people in a bar in Jaral del Progreso near the border with Michoacán state. More than two dozen people were killed in an unregistered drug rehabilitation center in Irapuato in July.