The two shootings are believed to be related to a dispute between rival gangs in Ciudad Victoria, said Herminio Garza Palacios, secretary general of Tamaulipas state, without identifying the groups.
Gunmen burst into a home in the Lopez Mateos district at 7:00 am (1200 GMT), killing two men, four women and five girls, he said in a video message.
Some 45 minutes later, armed men stormed the other family’s home in the Revolucion district, killing a man and two women and wounding four others.
State and federal authorities are investigating the crimes and seeking the killers, the official said.
“According to our preliminary investigation, it is presumed that those events were a product of a dispute between two rival gangs in the city,” Garza Palacios said.
Helicopters overflew Ciudad Victoria following the shootings, rattling nerves in the capital of Tamaulipas.
Tamaulipas is one of the country’s most violent states, where the Gulf and Zetas drug cartels have fought ultra-violent turf wars for years.
The Gulf cartel has been hit by infighting following the arrests or killings of several leaders, while the Zetas have been weakened by the capture of its capos.
The state, which borders Texas, is a major transit route for drugs shipped to the United States.
Last month, police killed eight gunmen who attacked them on a road in the town of San Fernando.
In March, government forces killed 10 criminal suspects in the border city of Reynosa as a gang blocked roads with burning vehicles in a bid to thwart an anti-cartel operation.
The state’s roads are considered so dangerous that police have a program offering to escort motorists from the border to Ciudad Victoria.
In a high-profile kidnapping in May, Mexican football forward Alan Pulido — who plays in Greece for Olympiakos — was kidnapped in Ciudad Victoria after leaving a party. Police freed him 24 hours later after Pulido beat up one of the kidnappers and called an emergency number.
More than 100,000 people have been killed or gone missing across Mexico since 2006, when the government escalated its battle against drug cartels.
Some 28,000 people are reported missing in the country, 5,000 of them from Tamaulipas, according to official figures.