Mexican security forces on Sunday killed seven more members of a presumed cartel assault force that rolled into a town near the Texas border and staged an hour-long attack, officials said, putting the overall death toll at 20.

The Coahuila state government said in a statement that authorities aided by helicopters were still chasing remnants of the force that arrived in a convoy of pickup trucks and attacked the city hall of Villa Union on Saturday.

Gov. Miguel Angel Riquelme said late Sunday afternoon that authorities had determined the casualty count from the gunbattles stood at 14 gunmen dead and four police officers killed. He said two civilians also were slain by gunmen after being abducted.

The reason for the military-style attack remained unclear Sunday. Cartels have been contending for control of smuggling routes in northern Mexico, but there was no immediate evidence that a rival cartel had been targeted in Villa Union.

Earlier Sunday, the state government had issued a statement saying seven attackers were killed Sunday in addition to seven who died Saturday. It had said three other bodies had not been identified, but its later statement lowered the total deaths to 20.

The governor said the armed group stormed the town of 3,000 residents in a convoy of trucks, attacking local government offices and prompting state and federal forces to intervene. Bullet-riddled trucks left abandoned in the streets were marked C.D.N. — Spanish initials of the Cartel of the Northeast gang.

A damaged pickup truck is seen in Villa Union after the gunbattle. Four police officers were among those killed in the exchange of gunfire, about 60 kilometres from the U.S. border. (Gerardo Sanchez/The Associated Press)

Several of the gunmen stole vehicles as they fled and kidnapped locals to help guide them on dirt tracks out of town, the governor said. At least one of the stolen vehicles was a hearse headed for a funeral, according to the newspaper Zocalo of Saltillo.

The town is about 60 kilometres south-southwest of Eagle Pass, Tex., and 20 kilometres from the town of Allende — site of a 2011 massacre involving the Zetas cartel in which officials say 70 died.

Videos of the shootout posted on social media showed burned out vehicles and the facade of Villa Union's city hall riddled with bullets. Rapid gunfire could be heard in videos, along with frantic people telling friends to stay indoors.

The governor said security forces would remain in the town for several days to restore a sense of calm.

Falko Ernst, senior Mexico analyst for the non-profit Crisis Group, which seeks to promote peace, said there are few incentives for armed groups in the country to refrain from violence.

"Solving this issue — which underpins impunity — would have to be the centrepiece of an integrated security strategy. But such a thing is yet to be presented by [President] Lopez Obrador and his team," said Ernst.

"The price of that absence is not least the flaring up of regional conflict scenarios."

Mexico's murder rate has increased to historically high levels, inching up by 2 per cent in the first 10 months of the presidency of Andres Manuel Lopez Obrador. Federal officials said recently that there have been 29,414 homicides so far in 2019, compared to 28,869 in the same period of 2018.

The November slaughter by Mexican drug cartel gunmen of three women who held U.S. citizenship and six of their children focused world attention on the rising violence.

Saturday's attack also showed cartels again resorting to quasi-military operations in a brazen challenge to state authority.

In October, a massive operation by the Sinaloa cartel prompted the federal government to release the captured son of a drug lord and pull back the army, which found itself outmaneuvered on the streets of Culiacan.

U.S. President Donald Trump said in a radio interview last week that he plans to designate Mexican drug cartels as terrorist organizations, though he declined to say what actions might follow that designation.

Mexican officials have opposed such a designation, worried it could lead to unilateral U.S. interventions in its territory.

Coahuila state itself has been far from the worst-hit part of Mexico amid violence in recent years. The government census bureau's survey of public perceptions of security found that Coahuila ranked well this year, with only three other states having a higher public perception of safety.