"He had a criminal record for various crimes, including kidnapping, for which he did time in prison," Lara said.

"We can presume this was a settling of scores. Evidence indicates a hit squad was sent to the home to kill [the victims]."

Another victim was an employee of the Mexico City public security service, he said.

Four children were found unharmed, public security spokesman David Pichardo told AFP news agency.

Mexico: Outrage grows over record murder rate

One of the children told authorities that masked men wearing police uniforms had arrived during the party and killed all the adults, according to newspaper Excelsior.

Authorities had cordoned off the entire neighbourhood on Thursday morning, and security was tight. Forensic workers could be seen examining the crime scene.

Mexico has seen a surge of deadly violence in recent months, extending to areas that were once considered relatively calm. That includes Hidalgo, which sits just north of the capital, Mexico City.

Murders hit a record high in May, according to the latest official data: 2,186 homicides, an average of 70 a day and the most since the country began keeping track 20 years ago.

The violence is largely fuelled by powerful, ultra-violent drug cartels.

Since Mexico deployed the military to fight drug trafficking in 2006, a wave of bloodshed has left more than 200,000 people dead or missing as rival cartels wage war on each other and the army.

Recently, hitmen have been wiping out entire families - including children - in a sign that the unspoken code of honour that once governed the turf wars and revenge killings of Mexico's cartels is fraying.