The government of the northern state of Tamaulipas says the battles began with an ambush-style attack that killed two federal police officers on a patrol.
The army was called in and came under fire from four gunmen in a pickup truck with improvised armouring. They were killed, as were six other gunmen in ensuing gunbattles.
The government says two passing motorists were also killed by stray bullets.
Tamaulipas drug gangs often weld steel plates onto normal vehicles.