MEXICO CITY — The number of homicides in Mexico last year was higher than originally thought, with national statistics institute INEGI reporting Monday that there were 31,174 slayings in 2017.

That is the most since comparable records began being kept in 1997, including the peak year of Mexico's drug war in 2011.

The Interior Ministry previously reported 29,168 homicides for 2017.

Data from the statistics institute is seen as more thorough, since INEGI visits morgues and public registries to collect information. The Interior Ministry counts homicide investigations that could involve multiple victims, thus potentially underrepresenting killings.

INEGI said the homicide rate last year broke down to 25 per 100,000 inhabitants — near the levels of Brazil and Colombia at 27 per 100,000. Mexico's rate was 20 per 100,000 people in 2016.

Honduras and El Salvador — among the deadliest countries in the world — have homicide rates of around 60 per 100,000. Some U.S. cities, like Chicago, Detroit and New Orleans, also top Mexico's per-capita homicide rate.

But some parts of Mexico are singularly violent.

Mexico's deadliest state is Colima, on the Pacific coast, where killings rose 38 percent last year to a homicide rate of 113 per 100,000. The rate in Baja California, home to the border city Tijuana, nearly doubled as the Jalisco New Generation and Sinaloa cartels clashed over drug trafficking routes.

"The country is in a public security crisis," said Alejandro Schtulmann, president of Mexico City-based political risk firm EMPRA.

In addition to fights between criminal groups for territory in states such as Baja California and Quintana Roo, fuel theft has turned more violent and extortion cases are on the rise.

Central Mexican states such as Guanajuato and Puebla, known for their agricultural output and growing manufacturing base, have seen homicide rates spike in recent years because of fuel theft from pipelines operated by the national oil company, Petroleos Mexicanos.

"The problem now is not just the murder rate," said Schtulmann. "More citizens are being affected by crime than ever before in Mexican history."

Schtulmann pointed to a recent wave of property crimes, unprecedented killings of politicians in this year's elections and attempts to extort businesses in fancy neighborhoods like Polanco in the Mexican capital as indications that criminal activity is encroaching on more territory and affecting more segments of the population.

President-elect Andres Manuel Lopez Obrador, who takes office Dec. 1, has said he will tackle crime by creating educational and work opportunities for disenchanted youth.

Schtulmann finds Lopez Obrador's plans a bit vague, saying Mexico more than anything needs to improve state security forces since thinly stretched federal resources often can't reach all the trouble spots.

"We are talking about long-term efforts. This is not going to go away from one day to another," Schtulmann said. "If the opportunity is there, and the impunity is there, the criminals will keep committing crimes."

INEGI said it surveyed 2,127 civil registries, 688 public ministries and 145 forensic medical services to collect the 2017 data. Firearms were the leading cause of homicide deaths in 2017, with 20,049 gunshot victims.