SZEGED, Hungary (Reuters) - A Hungarian court on Friday sentenced 10 migrants to jail terms for illegally crossing the border during a riot in September 2015, after Hungary built a razorwire fence to seal its frontier with Serbia.

Police escort to the court a Syrian migrant who was put on trial for illegal border crossing, ahead of his court sentencing in Szeged, Hungary, July 1, 2016. REUTERS/Laszlo Balogh

It was the first case to come to trial under a law passed days before the incident that made illegal border crossing as part of a rioting crowd punishable by between one and five years in prison.

Nine of the migrants were sentenced to about a year in jail, but were released immediately as their sentences were cut by two-thirds at the judge’s discretion and offset by time they had spent in detention since September.

One migrant was kept behind bars after receiving a three-year sentence for issuing instructions to rioters through a loudspeaker. Both the prosecutor and defense appealed against the ruling.

Nearly half the more than a million migrants who surged into Europe last year passed through Hungary, often causing chaos at borders and along the main migration routes.

Hungarian Prime Minister Viktor Orban has taken a tough line against migration, and says the European Union risks seeing other member states follow Britain to the exit unless it does the same.

The mostly Syrian defendants convicted in Szeged, the capital of Csongrad, were part of a crowd that crossed into Hungary on Sept. 16 as hundreds of migrants forced open the border gate and police responded with water cannon and tear gas.

“The court deems them to be a part of the rioting crowd as they took advantage of the lack of control to enter Hungary and the European Union,” judge Janos Arany told the court.

All are to be expelled after serving their terms, and barred from re-entering Hungary for several years.

Slideshow ( 2 images )

Pressure on the border has decreased since a deal in March between the European Union and Turkey to slow migration into Europe in exchange for financial assistance, easing of visa rules and faster EU membership talks for Ankara.

A steady flow of migrants still passes through Hungary, with the total close to 20,000 this year.

WHEELCHAIR-BOUND MIGRANT

Those convicted included three disabled people, one of whom was pushed across the border in a wheelbarrow by a helper. The three had their sentences suspended.

Fahdawy Ghazy, maimed by an explosion in the Syrian war and now confined to a wheelchair, said he was guilty of no crime.

“I committed nothing,” the smiling Ghazy told Reuters through an interpreter.

“The court had no proof to the contrary despite nine months they had to build the case against us.”

Defense lawyer Tamas Fazekas, who works with the rights group Helsinki Committee, said the migrants were not to blame for a riot they merely witnessed.

“If I go to a football game and hooligans begin a brawl, I cannot be held responsible,” he said.

“The court failed to see that ... In any case, these people fled war and therefore are entitled to international protection, not prosecution.”

United Nations refugee agency spokesman Erno Simon told Reuters he was relieved that only one of the 10 defendants would remain behind bars.

“Still it has been worrying us from the start that Hungary criminalizes people fleeing war,” he said. “They have now been declared criminals.”

In a separate case, prosecutors on Friday charged two Romanians with human trafficking and one with attempted murder and cruelty for trying to smuggle more than 100 migrants from Hungary to Austria in an unventilated truck compartment last June.