(CNN) Soaring levels of drug-related violence made 2017 Mexico's most murderous year on record, according to government statistics released Sunday.

There were 25,339 homicides in Mexico last year, a 23% jump from 2016 and the highest number since at least 1997, the year the government began tracking the data. Overall, murders in Mexico had been declining in recent years, reaching a low of 15,520 in 2014. But officials say a surge in drug-related crime reversed that trend.

Many parts of western Mexico, including the states of Guerrero, Jalisco, Sinaloa and Baja California Sur, have been caught up in violence between competing drug cartels.

The country has also become -- outside of the world's war zones -- one of the most dangerous places for journalists.

Last year six journalists were killed in Mexico, according to the Committee to Protect Journalists, a US nonprofit. That was the highest number since at least 1992. Since that year more than 40 journalists have been killed in the country.

Read More