MEXICO CITY -- Seven Mexican soldiers have been formally charged with crimes ranging from homicide to improper conduct in connection with the shooting deaths of suspected gang members at a rural warehouse on June 30, officials said Sunday.

Authorities initially said that all 22 suspected gang members died in a shootout with soldiers in a confrontation near Tlatlaya, a rural community about 153 kilometres southwest of Mexico City. But witness statements and evidence from the scene contradicted the official version of events. Authorities later arrested the soldiers but said only three had participated in the killings.

All seven were accused before a civilian judge of "actions improper to the public service" and three face more serious charges including aggravated homicide over the deaths of eight people, according to a statement released Sunday by the Federal Judiciary Council.

The three accused of homicide are Fernando Quintero Millan, Roberto Acevedo Lopez and Leobardo Hernandez Leonides.

Authorities had said earlier that seven soldiers and a lieutenant were being held in the case, but Sunday's judicial statement only mentioned seven people. The soldiers will remain in a military prison in Mexico City.

Mexico's National Human Rights Commission, which conducted an investigation into the deaths, has said that at least 15 of the 22 people killed that day were executed by soldiers after the confrontation.

The commission also said in its Oct. 21 report that there were attempts by civilian and military authorities to cover up what happened.

Attorney General Jesus Murillo Karam said in October that a witness confirmed the official version of events in a declaration, though the woman had told The Associated Press and Esquire magazine weeks earlier in separate interviews that 21 of the victims were killed after surrendering.

The witness spoke to The AP on condition of anonymity fearing reprisals.

AP journalists who visited the warehouse days after the incident found little evidence of an extended shootout. On the walls were bullet holes at chest level, suggesting shots fired at close range.

The United Nations, the U.S. and the European Union have called on Mexico to conduct an independent investigation into the deaths.

Tlatlaya is one of several cases, including the disappearance of 43 college students in Guerrero state, that have called into question the respect for human rights in Mexico.