A government official said several dozen militants attacked a village , but troops beat them back , killing many of the insurgents .