The federal officers were on patrol on a road in the town of San Fernando, in the violence-plagued state of Tamaulipas, when armed civilians arrived in two pick-up trucks and opened fire, a regional security task force said in a statement.
"While repelling the attack in self-defense, the federal police killed eight assailants," the Tamaulipas Coordination Group said in a statement, adding that the gunmen have yet to be identified.
A police car was left with several bullet holes but none of the officers were hurt. The six rifles and grenade launchers were found in the two pickups along with cartridges of various calibers and a smaller gun.
Tamaulipas, which borders the US state of Texas, is among the most violent in Mexico, with the Gulf cartel also wreaking havoc in the region.