Ten people were killed in a gunfight in western Mexico when suspected gang members ambushed a police convoy. It was one of the deadliest attacks on security forces since the Mexican president, Enrique Peña Nieto, took office in December 2012.

Five members of Mexico’s new militarised police, or gendarmerie, were killed in the shootout on Thursday night in Ocotlán, Jalisco state, and eight others were wounded, the national security commission said in a statement.

Two bystanders who apparently had nothing to do with the ambush and three suspected gang members were also killed. Units of the gendarmerie were patrolling the town south-east of the state capital, Guadalajara, the commission said.

At least 10 vehicles took part in the attack on police, with the assailants firing high-powered rifles before being beaten back. Some of the attackers fled.

Police confiscated seven firearms and four fragmentation grenades at the scene, as well as five vehicles believed to have belonged to the assailants, the government said.

Jalisco has been plagued by fighting between the Jalisco “New Generation” drug cartel and the “Knights Templar”, a drug gang from the neighbouring state of Michoacán that has been gradually weakened by the capture or killing of its leaders.

More than 100,000 people have been killed in gang-related violence in Mexico over the past eight years.

Bringing peace to Mexico was Enrique Peña Nieto’s first promise when he took office in 2012. The gendarmerie was created to lead the government’s efforts to restore order. It began operating last summer, albeit on a smaller scale than originally envisaged.