The government of the border state of Tamaulipas says suspected drug gang members in each case opened fire on military or police.
The government said late yesterday all three incidents happened within a half hour between Reynosa and Matamoros, across from Brownsville, Texas.
Federal police killed three suspects in the first incident. Marines then killed nine suspects who purportedly had an armoured vehicle.
The army then killed seven suspects, two of whom allegedly had .50-cailber rifles.
No military personnel were apparently wounded.
The statement came the same day that Mexico's National Human Rights Commission reported that soldiers had executed 12 to 15 suspects in a June 30 incident in southern Mexico.