Mexican authorities have charged three soldiers with murder after they were allegedly involved in the deaths of 22 people suspected to be gang members, who witnesses claim were executed.

Attorney General Jesus Murillo Karam said that after team of eight servicemen was engaged in a brief firefight, three of them entered a warehouse where the suspect had taken shelter and opened fire with "no justification whatsoever".

The incident happened in the rural town of Tlatlaya in June, in an area south-west of Mexico City known to be dominated by drug cartels.

Initially, the army claimed 22 gang members - all teenagers or in their early twenties, were shot dead during a gun battle with security forces.

The official account was disputed after it emerged only one soldier was wounded and AP reporters visited the site, unveiling some inconsistencies.

The journalists said there were no signs of a prolonged battle, while blood and bullet marks inside a warehouse where the bloodshed occurred suggested at least five people had been shot in the chest from a close range while standing against a wall.

Later a woman claimed she saw soldiers shooting her 15-year-old daughter more than half a dozen times as she lay on the ground injured.

Karam's account seemed to contradict a July report by the state of Mexico prosecutors' stating there was "no evidence at all of possible executions".

But the attorney general didn't provide any details about whether the suspects had already surrendered or were unarmed when the killings took place.

"Doesn't it seem strange that eight soldiers face off against 22 suspects and all the deaths are on the side of those with numeric superiority?" said Alejandro Hope, a Mexico City-based security analyst. "What was this, a squad of Rambos? Or had the suspects already been disarmed? Whichever way, this doesn't smell good."

Last week, the eight soldiers involved in the shooting were arrested by the army and charged with crimes against military discipline, disobedience and dereliction of duty over the June shooting.

Those charges are separate from the attorney general's civil probe.