The European Union’s highest court ruled Tuesday that a Hungarian law passed in 2018 — which the government calls the “Stop Soros” act — violated E.U. law by criminalizing people who help migrants and refugees apply for asylum.

The European Court of Justice ruling does not annul the legislation backed by far-right Hungarian Prime Minister Viktor Orban, but the Luxembourg-based court could impose financial penalties if the law is not amended “without delay.”

Orban’s political clout, both at home and abroad, centers on his anti-immigrant and hyper-nationalist policies. He has clashed with E.U. bodies over his efforts to keep out migrants and asylum seekers and to crackdown on organizations seen as sympathetic to refugees or his political opponents.

The 2018 law in question outlawed helping immigrants who had entered Hungary illegally to apply for asylum. Violators faced up to one year in prison. The legislation also tightened Hungary’s rules around who can apply for asylum inside the country.

The government dubbed the law the “Stop Soros” act to target one of Orban’s political nemesis, liberal philanthropist George Soros, whom the Hungarian leader frequently denigrates amid crackdowns on his opponents and free-speech advocates.

Orban has accused Soros, a Hungarian-born Jewish American billionaire, of using foreign funding to encourage immigration to Hungary. Critics say Orban is trafficking in conspiracy theories based in xenophobia and anti-Semitism.

In its ruling Tuesday, the court said the 2018 legislation violates E.U. law, as it “restricts, first, the right of access to applicants for international protection and the right to communicate with those persons and, second, the effectiveness of the right afforded to asylum seekers to be able to consult, at their own expense, a legal adviser or other counsellor.”

Hungary also failed to uphold E.U. obligations by further restricting criteria for seeking asylum, the court found.

Brussels has opposed the law since its passage in June 2018. The following month, the European Commission opened an infringement procedure in an effort to force Hungary to reverse the legislation. When Orban’s government did not respond, the commission referred the case to the European Union’s Court of Justice, according to Euronews.

Hungary’s international spokesman, Zoltan Kovacs, rejected the court’s conclusion in a statement posted to Twitter on Tuesday.

While Hungary will “accept the judgment” of the E.U. court, Kovacs said, “we reserve the right to take action against the activities of foreign-funded NGOs, including those funded by George Soros.”

“As long as there is a national government in Hungary, it will enforce the will of the Hungarian people and prevent Hungary from becoming an immigrant country,” Zoltan said in the statement posted online.

David Vig, Hungary director for Amnesty International, praised the ruling in a statement, saying it “sends an unequivocal message that the Hungarian government’s campaign of intimidation, targeting those who stand up for the rights of refugees and asylum seekers cannot, and will not be tolerated.”

“It is now time for the Hungarian government to implement the court’s decision and immediately withdraw this piece of shameful legislation,” he said.

While Hungary’s law sparked international outrage, countries across Europe have used anti-trafficking laws and passed legislation to criminalize and discourage aid for migrants and asylum seekers since the height of the continent’s migration crisis in 2015.

On Sunday, Poland’s Parliament passed a law that advocates for refugees say legalizes the country’s pushback against migrants and asylum seekers being encouraged to cross from Belarus amid it’s standoff with the European Union.

A 2019 report by British-based OpenDemocracy found that at least “250 people across 14 countries who have been arrested, charged or investigated under a range of laws over the last five years for supporting migrants.”

Most cases were from Britain, Denmark, France, Germany, Greece, Italy and Spain, according to the report. (The site has received grants from Soros charities.)

In one high-profile case going to trial Thursday in Greece, 24 people affiliated with a search-and-rescue nonprofit, including a Syrian refugee, face a litany of charges that carry sentences of as much as 25 years in prison. They face accusations of spying, disclosing state secrets, people smuggling, money laundering and belonging to a criminal group, Reuters reported.

Amnesty International has denounced the case as “farcical” and intended “to deter people from helping refugees and migrants.”

The organization, the Emergency Response Center International (ERCI), operated search-and-rescue missions around Greece’s Lesbos island from 2016 to 2018. Teams of volunteers and aid workers set up on Lesbos to assist refugees and asylum seekers arriving in overcrowded boats, often after enduring harrowing trips or becoming lost at sea.

“If you saw someone drowning you would do the same as me, you would reach out a hand, pull them out, and that’s the exact same crime that I’m accused of doing,” Sean Binder, a German national who served as a rescue diver, told Reuters.

After his arrest in 2018, Binder spent 107 days pretrial detention in a maximum security prison in Athens.

“I never for a moment thought that trying to help somebody out at sea would land you in prison,” he said.