El Salvador's new National Police chief says he has been ordered to crack down on gangs in the face of rising attacks on security forces.

Mauricio Arriaza Chicas says new President Nayib Bukele is taking a strong stance on the issue. He adds that police will act "according to the law against any criminal group that is attacking the safety of the people."

Bukele also weighed in Wednesday, tweeting: "Unfortunately they have us cornered and they only leave us one option. And it is not truce."

So far this year, gangs are blamed for the killings of 23 police officers and 12 soldiers, most of them when they were on their days off.

According to government figures, 34 officers and 17 military members were killed in all 2018.