The afternoon gun battle took place near the border town of Rio Bravo, the military source told AFP, speaking on condition of anonymity.
Gunmen inside a house apparently opened fire at soldiers on patrol in a rural area near Rio Bravo, the source said.
After the shootout, the soldiers confiscated seven armed vehicles and arrested a man in a nearby home who had an AK-47 assault rifle.
The source did not indicate the gunmen’s gang affiliation.
The paramilitary Zetas drug cartel is active in the region, along with their rivals, the Gulf Cartel.
More than 4,000 Mexican soldiers have been deployed to Tamaulipas state — a key corridor for smuggling drugs into the United States — to crack down on the thriving narcotics trade.