LONDON - A Hungarian appeals court will make its final verdict Thursday in the case of a man convicted of terrorism for throwing stones at police and trying to enter the country illegally, at the height of the migrant crisis in 2015.

Amnesty International says his actions can in no way be interpreted as terrorism. The human rights group says the hearing in Budapest is the first big test for the country's judicial system since the European Parliament voted last week to sanction Hungary over its record on fundamental rights.

The defendant, named as Ahmed H., was living in Cyprus at the time of the alleged offense. In the summer of 2015, he traveled to the Balkans to help his elderly parents and other family members as they fled the war in Syria. Like hundreds of thousands of other migrants and refugees, they were making their way from Turkey to Greece, through the Balkan states, trying to reach Western Europe.

Their journey was halted at the Hungarian-Serbian border as authorities closed the crossing. Ahmed took part in protests that erupted at the border

Hungary Migrants
FILE - Syrian immigrant Ahmed Hamed holds a paper in his hands in the courtroom during his appeal trial in the appeals court in Szeged, 170 kms southeast of Budapest, Hungary, June 15, 2017.

"He threw a few stones and he urged the police to let the refugees and migrants who had amassed there cross through to Hungary," said Eda Seyhan of Amnesty.

Ahmed was arrested by Hungarian police. In 2016, he was convicted on charges of terrorism and sentenced to 10 years in jail.

"The defendant himself shook the fence, and fiddled with the lock, and threw solid objects towards the policemen line on three occasions," the judge, Andrea Nagy, read after the verdict.

Following an appeal, Ahmed was again convicted of terrorism in a retrial. His latest appeal is his final hope of overturning the conviction in the Hungarian judicial system.

Amnesty's Seyhan says Ahmed's case is symptomatic of Hungarian Prime Minister Viktor Orban's vilification of migrants.

"The Orban government have tried to justify their refusal of asylum-seekers and their ill-treatment of refugees by arguing that refugees and terrorism are in some way associated," Seyhan said. "Having found no evidence for this assertion, they've really used the Ahmed case to back up their claims."

The European Parliament last week voted to enact so-called Article 7 sanctions against Hungary for flouting EU rules on fundamental rights. During a debate ahead of the vote, Orban claimed he was legitimately defending Europe's external borders.

"Hungary is going to be condemned because the Hungarian people have decided that this country is not going to be a country of migrants," Orban told EU lawmakers.

But Amnesty sees the upcoming verdict as a new chance for Hungary.

"What we're hoping for on Thursday is that Hungary will see the trial of Ahmed as an opportunity to show to the international community and others that it is coming back on a path of the rule of law and of human rights," Seyhan said.

That battle over Hungary's future path played out Tuesday on the streets of Budapest as thousands of anti-government protesters demanded new elections.