New law that forces foreign-funded groups to register with authorities slammed by critics as attempt to stifle dissent.

Hungary’s parliament has approved strict new regulations for foreign-backed civil society groups despite calls from the European Parliament and rights groups for the bill to be dropped.

The legislation, drafted by Prime Minister Viktor Orban’s government and pushed through by the ruling Fidesz on Tuesday, compels groups that get more than $26,200 a year from abroad to register with the authorities and declare themselves as foreign-funded, or risk closure for non-compliance.

The government said the measures were aimed at improving transparency, as well as fighting money laundering and “terrorism” funding.

But the European Commission and the United Nations have condemned the law, saying it could “discriminate against and delegitimise” non-governmental organisations.

READ MORE: Court rules against sending asylum seekers to Hungary

John Dalhuisen, Amnesty International’s European director, said the new rules were aimed at “obstructing and discrediting critical civil society voices”.

Orban, 54, who will seek re-election for a third consecutive term in April 2018, has been campaigning hard against NGOs funded by Hungarian billionaire George Soros, saying they were a “mafia-like” network employing paid political activists who posed a threat to national sovereignty.

Orban’s Fidesz party has a firm lead over the opposition in opinion polls.

On Monday, Soros’s Open Society Foundations, which disburse funding to several prominent NGOs in Hungary, said the bill “seeks to suppress democratic voices in Hungary” and “attacks Hungarians who help fellow citizens challenge corruption and arbitrary power”.

Earlier this month the EU’s rights watchdog, the Venice Commission, said the NGO bill was “excessive” despite pursuing “legitimate aims”, and accused some state authorities of staging a “virulent” campaign against NGOs.

Amendments to the bill took into account some of the commission’s recommendations, such as dropping a requirement for the details of all foreign donors to be named on a group’s publications.

Tuesday’s vote follows the hasty approval of another law in April that threatens to shut the Soros-founded Central European University in Budapest.

The crackdown on the CEU and NGOs sparked a large protest in April in the Hungarian capital.

The European Parliament adopted a resolution last month condemning Hungary for the “serious deterioration” in the rule of law and fundamental rights and called on the government to withdraw the bill on foreign-funded NGOs.