ATHENS (Reuters) - A Greek court has handed a five-year prison sentence to three civilian men who took vigilante action and held 13 migrants and refugees in a trailer, believing they were involved in a 2023 deadly fire in the northeast, legal sources said on Thursday.

The Evros fire, Europe's deadliest last year which took the lives of at least 20 people, mostly migrants, had spurred anti-immigrant sentiment, according to Greece's Racist Violence Recording Network (RVRN) made up of NGO groups. The network said attacks by civilian militia groups on migrants were not new in the region.

But the court this week said the three men's motives were not racist, a ruling that lawyers defending the migrants said was a negative development that undermined such attacks in the country.

Charges of attempted arson initially laid against the migrants were dropped after investigating judges this year ruled that the evidence was not enough to back those accusations.

Police had arrested the three men in August 2023 on accusations of kidnapping the 13 undocumented migrants, mainly Syrians and Pakistanis who had crossed the Greek-Turkish border of Evros, in a racially motivated attack, according to court documents.

Those arrests came after a video emerged on social media showing the migrants in a trailer pulled by a jeep. One man was heard saying he had loaded the trailer with "25 pieces" and urged civilians to "round up" migrants he accused of arson.

The court downgraded the earlier charge of kidnapping to one of illegal detention, legal sources said. Greek courts do not publish their rulings immediately.

"It's obviously a negative development," said John Patzanakidis, a lawyer representing the migrants. "The number of racist crimes recorded in Greece is just the tip of the iceberg. Only a few of them reach the court and in even fewer, the court recognises a racist motive."

The three men were given a custodial sentence, in which they do not need to be held physically in jail pending an appeal's court ruling.

Lawyer Michalis Dimitrakopoulos, representing two of the defendants, said the sentence imposed was austere as the men had detained the migrants on suspicion they were arsonists, to hand them over to police.

Most of those killed in the Evros fires were migrants and refugees crossing over from Turkey and hiding in forests.

(Reporting by Renee Maltezou; Editing by Bernadette Baum)