By Gergely Szakacs

SZEGED, Hungary (Reuters) – A Hungarian court sentenced a Syrian-Cypriot man to five years in prison on Thursday for crossing the border as part of a riot during the migrant crisis, in a case that has drawn criticism from the European Parliament and Amnesty International.

Ahmed Hamed was among a group of migrants that crossed into Hungary on Sept. 16, 2015 from Serbia, pelting policemen with rocks before hundreds of migrants forced open the border gate and police fired water cannon and teargas.

He was provisionally sentenced in March to seven years in jail for illegally crossing the border and for being an accomplice in what the court called a “terrorist act” during clashes with police at the border.

Thursday’s final ruling in the case, which has drawn criticism of Hungary’s hardline stance against Muslim immigration to Europe, relaxed the sentence to five.

The court upheld the preliminary verdict that Hamed should be expelled from Hungary for 10 years.

Hamed’s case featured in a report on the rule of law in Hungary, which culminated last week in an unprecedented decision by the European Parliament to sanction Hungary for flouting EU rules on democracy, civil rights and corruption.

Prime Minister Viktor Orban’s tough stance against immigration has pitted Hungary against fellow European Union members Germany and France. As well as building a steel fence on its southern border, Hungary has toughened laws on immigration and clamped down on non-government organisations that Orban accuses of supporting illegal immigration.

Human rights group Amnesty International has said it believed the terrorism clause was unduly applied in Hamed’s case by Hungarian authorities. On Tuesday, it submitted a petition to the Hungarian Justice Ministry calling for Hamed’s release.

The court found that the terrorism clause was applicable as Hamed and others acted in concert to force the border open.

The final ruling relaxed the seven-year verdict issued in March as the court considered new mitigating circumstances in the case, Judge Erik Mezolaki told a courtroom packed with dozens of journalists.

“The objective of punishment is to deter either the accused or anyone else from committing a crime,” Mezolaki said. “Retribution does not fall under the scope of punishment.”

The court considered the fact that Hamed does not speak Hungarian, and that he has been separated from his family, as mitigating circumstances, as well as the fact that he has been detained for more than three years, the judge said.

That means he is likely to serve two years in jail.

The European Parliament’s report said the court ruling issued in March raised “the issue of proper application of the laws against terrorism in Hungary, as well as the right to a fair trial.”

(Reporting by Gergely Szakacs; Editing by Susan Fenton)