Updated

A Hungarian court has sentenced a Syrian man to seven years in prison after convicting him in a retrial of entering Hungary's illegally and committing an act of terror by throwing rocks at police during a 2015 border riot.

Ahmed Hamed had been sentenced to 10 years in prison in November 2016 but an appeals court annulled his conviction and ordered a retrial.

The case stems from rioting on Sept. 16, 2015, when dozens of police officers, migrants and some journalists were injured in clashes on the Hungary-Serbia border a day after Hungary closed the frontier, stranding hundreds of migrants.

Prime Minister Viktor Orban's government has frequently used Hamed's case in propaganda campaigns seeking support for its strict anti-migration policies.

Amnesty International said the conviction was a "travesty of justice."