The Peruvian Supreme Court could release members of a military death squad who took part in notorious 1990s killings under the government of Alberto Fujimori.
Peruvians are reacting with widespread anger.
In the 3-2 ruling, seven members of the so-called Colina death squad created under the auspices of then-spy chief Vladimiro Montesinos may now apply immediately for parole, legal experts say.
The court also overturned the aggravated murder conviction and 15-year sentence of Montesino's army intelligence chief, Alberto Pinto, for providing financial and logistical support to the Colina group.
Pinto was released from prison on Tuesday.
In its ruling Friday regarding 25 killings of which the Colina squad was convicted, including the slaying of an 8-year-old boy, the five-judge panel said they were not "crimes against humanity" but simple murders. It also said Pinto was only following orders.
Defendants convicted of crimes against humanity in Peru are not eligible for parole. Those convicted of murder are eligible after serving two-thirds of their sentence.
Fujimori, 73, is currently serving a prison sentence for massacres and other human rights violations that took place during his tenure.
Friday's decision trimmed the prison sentences of 15 former military men as well as Montesinos, who as national security adviser to Fujimori helped him maintain power by thwarting the rule of law through violence, bribery and intimidation. Most of the 15 had their sentences reduced from 25 to 20 years.
Writing for the court, Judge Javier Villa Stein said the men could not be made to serve sentences for crimes against humanity because the prosecutor in the case had not specifically sought to convict them on that charge. The prosecutor refutes that, however, as do court documents filed in 2005.
Montesinos, 67, will not be eligible for parole any time soon. He has been convicted and sentenced for a series of other crimes including running guns to Colombian rebels.
Peruvian courts have found that the Colina group committed 53 murders of alleged leftist rebel sympathizers and other civilians from 1991 to 1996 with the knowledge of high-ranking officials in the Fujimori government.
The rulings determined that the Fujimori government gave the group state funds, medical insurance, automobiles, weapons and training.
Legal expert Jose Balcazar-Quiroz lamented the conversion of systematic killings ordered by Fujimori's government from crimes against humanity to simple murders.
"The Colina now become like a group of crazies who one day said, 'Let's go kill on our own,'" the Catholic University professor said.
Villa Stein, defending the ruling, said in a TV interview on Monday that he didn't consider the killing of the 8-year-old at a party in the Barrios Altos neighborhood a crime against humanity. In all 15 people were killed at the barbecue, including the boy's father.
"To kill a child is a terrible crime but that doesn't convert it into a crime against humanity," Stein said.
Human rights attorney Gloria Cano, who represents 14 victims of the Colina group, said the ruling contradicts a 2001 decision by the Inter-American Court of Human Rights that deemed the killings crimes against humanity.
Pro-Fujimori lawmaker, Alejandro Aguinaga, said the former president now should also be eligible for parole because Fujimori was convicted of crimes against humanity in 2009 in the Colina group killings. Fujimori is serving a 25-year sentence.
Peru's top anti-corruption prosecutor, Julio Arbizu, said he believes parole for Fujimori on those grounds would be a legal impossibility because Fujimori already appealed his sentence and lost.
President Ollanta Humala and his wife, Nadine Heredia, were among those criticizing the decision.
Heredia tweeted that the ruling "stains the honor of our country."