Indigenous people attended a hearing at which four men were given near three-decade sentences for the murders of four Amazon land defenders who had crossed swords with illegal loggers. AFP

A Peruvian court on Thursday imposed near three-decade sentences on five men who were being retried for the murders of four Indigenous Amazon land defenders who had crossed swords with illegal loggers.

The four leaders of the Ashaninka people -- a group from a remote area along the border between Brazil and Peru -- were killed in front of members of their community on September 1, 2014.

Edwin Chota, Jorge Rios, Leoncio Quintisima and Francisco Pinedo were "murdered by presumed illegal loggers for defending their land," Peru's main Indigenous organization, AIDESEP, said at the time.

At least one of them -- well-known environmental activist Chota, had received threats for standing up to the intruders.

On Thursday, judge Karina Bedoya sentenced brothers Josimar and Segundo Atachi as well as Jose Carlos Estrada, Hugo Soria and Eurico Mapes to prison terms of 28 years and three months each as "coauthors of aggravated homicide."

Prosecutors had sought 35-year prison sentences.

The five were already found guilty of the crime last February, and were sentenced to 28 years in prison each.

But an appeals court threw out that ruling and ordered a new trial for "irregularities" in the testimony of a witness.

The new trial started last November.

Relatives of the victims attended Thursday's ruling at a court in the northeastern city of Pucallpa after participating in a community vigil.

Also present were Peru's Justice Minister Eduardo Arana and diplomatic representatives from the United States, the European Union and the United Nations.

"I am happy with the sentence," 47-year-old Lita Rojas, widow of Leoncio Quintisima, said after the ruling, as members of the Indigenous community celebrated outside the court.

Rojas and others had travelled for two days by river and road from their remote community of Alto Tamaya-Saweto near the Brazil border.

"Justice was done! No more impunity for killers of environmental defenders," the DAR, an environmental NGO, said on social network X.

The murders had unleashed a wave of criticism against Peruvian authorities, who were accused of not doing enough to protect Indigenous leaders and anti-deforestation activists.

According to the NGO Global Witness, at least 54 land and environmental defenders have been killed in Peru since 2012, of whom more than half belonged to Indigenous groups.

Families of the four hope the ruling will serve as a precedent to protect other Indigenous leaders and environmental advocates.

The four families have requested compensation of some $66,000 for each conviction.