The confrontation broke out shortly before noon in Villa Union in the northern state of Coahuila when officers detected several vehicles and heavily armed passengers touring the small community, which is roughly 60 kilometres (40 miles) from the US border.
Four of those killed were police, seven were suspected criminals and another three unidentified bodies were found nearby on a rural road, Coahuila governor Miguel Angel Riquelme told reporters.
Six officers were also wounded but their injuries were not serious and they had already been discharged from hospital, Riquelme said.
An unspecified number of people — including a child — were also missing, government officials added.
Local authorities said twelve trucks were seized in the operation, as well as several high-calibre weapons and an unspecified load of ammunition.
Video shared on Riquelme’s official Facebook page showed the bullet-ridden mayor’s office, while images showed some of the chaos left after the confrontation.
The attack comes after Mexico’s leader Andres Manuel Lopez Obrador warned he would not allow the US to conduct cross-border armed operations against drug cartels in the country, after President Donald Trump said he planned to designate Mexican drug hangs as terrorist organizations.
The US president has been talking tough on the powerful drug cartels since one was allegedly responsible for the massacre of nine women and children from a US-Mexican Mormon community in northern Mexico on November 4.
Trump has said he would help Mexico tackle the drug gangs, and the two countries have cooperated closely in the fight against drug cartels.