Spanish prosecutors have dropped their investigation into the deaths of more than 20 migrants last June at the border between Morocco and the Spanish enclave city of Melilla, saying in a statement Friday they found no evidence of criminal misconduct by Spanish security forces.

Prosecutors said they spent six months investigating what happened when hundreds of migrants — some estimates say around 2,000 — stormed the Melilla border fence in northwest Africa from the Moroccan side in an attempt to reach European soil. At least 23 migrants were officially reported dead, though human rights groups say the number was higher.

“It cannot be concluded that the conduct of the (Spanish) security officers involved increased the threat to the life and well-being of the immigrants, so no charge of reckless homicide can be brought,” said the Spanish prosecutors.

The migrants, according to the prosecutors’ statement, were “hostile and violent.”

Hundreds of men, some wielding sticks, climbed over the fence from Moroccan territory and were corralled into a border crossing area. When they managed to break through the gate to the Spanish side, a stampede apparently led to the crushing of many people.

Moroccan police launched tear gas and beat men with batons, even when some were prone on the ground. Spanish guards surrounded a group that managed to get through before apparently sending them back.

The clash ended with African men, clearly injured or even dead, piled on top of one another while Moroccan police in riot gear looked on.

The Spanish prosecutors said that “at no point did (Spanish) security officers have reason to believe that there were people at risk who required help.”

Spanish security officers who turned 470 of the immigrants back to Morocco did so in accordance with their duty and in conformity with Spain’s immigration law, the statement said.

So-called “pushbacks” — the forcible return of people across an international border without an assessment of their rights to apply for asylum or other protection, violating both international and EU law — are a contentious issue in Europe.

The prosecutors did fault some security officers who threw rocks at the immigrants, recommending disciplinary procedures against them.

Amnesty International said earlier this month that the handling of the investigation by Spain and Morocco, which has remained mostly silent on the matter, “smacks of a cover-up and racism.”