MEXICO CITY — Mexican federal police officers summarily executed at least 22 people last year during a raid on an alfalfa ranch that had been occupied by members of an armed group, the country’s National Human Rights Commission said Thursday.

The commission’s report is a rebuke to Mexico’s security forces, stung by repeated accusations of human rights violations, and is an additional blow to the government of President Enrique Peña Nieto, which is struggling to contain rising drug violence.

The report by the commission, an autonomous government agency, concluded that the May 22, 2015, raid on the ranch, in which 42 civilians and one federal police officer died, was carried out in a way that involved serious human rights violations.

Although the commission agreed with the authorities who said that the ranch had been taken over by members of a drug gang and that the victims had fired at the police, its investigation concluded that many of the victims had been shot at close range, from behind or from above.