Seven Mexican soldiers have been formally charged with crimes stemming from the deaths of suspected gang members who were shot in a rural warehouse in June.

The Federal Judiciary Council issued a statement Sunday saying the seven are accused of "actions improper to the public service" and three face more serious charges including aggravated homicide over the deaths of eight people.

The charges stem from the June 30 deaths of suspected gang members near Tlatlaya, a rural community about 95 miles (153 kilometers) southwest of Mexico City. Authorities initially said all 22 people died in a shootout with soldiers. But witness statements and evidence from the scene contradicted the official version of events. Authorities later arrested the seven soldiers but said only three had participated in the killings.