BANGKOK — Thai soldiers repelled an attack on a military outpost early Wednesday, killing at least 16 gunmen in what appeared to be a significant setback for ethnic insurgent groups leading a bloody uprising now in its ninth year.

Col. Pramote Promin, the spokesman of the army’s southern command, said the army had been expecting the attack after being tipped off by villagers and “former insurgents fed up with the violence.”

“This helped us to be fully prepared,” Colonel Pramote said.

Thai authorities said that one of the men killed in the attack, Maroso Jantarawadee, was an important leader of the insurgency.

Srisompob Jitpiromsri, the associate dean at Prince of Songkla University in the southern city of Pattani and one of the foremost experts on the insurgency, described Wednesday’s failed insurgent attack as a “tactical defeat” for them.