Brussels, Belgium: The European Commission urged Hungary on Saturday to drop a planned law that critics have denounced as an attempt to muzzle NGOs and independent media in the country.

Under its nationalist prime minister, Viktor Orban, Hungary has tightened control over courts, media outlets and civil society, drawing accusations from fellow EU countries of flouting the rule of law.

Orban’s government says the so-called Transparency in Public Life bill aims to dismantle a foreign-funded “propaganda network”.

But the European Commission warned that it would “not hesitate to take the necessary action if this draft is adopted”.

“It would constitute a serious breach of EU principles and law,” it said, adding that it “remains committed to protecting the freedom of association and fostering an enabling environment for its work across the EU”.

Tens of thousands of people protested in Budapest last Sunday against the law, which would let the government blacklist organisations that “threaten the sovereignty of Hungary by using foreign funding to influence public life”.

This month, a group of European lawmakers urged Brussels to freeze all funding to Hungary, accusing it of restricting freedoms and undermining democracy contrary to EU laws and values.

The European Union has already frozen around 19 billion euros ($20 billion) in EU funds earmarked for Hungary over issues including alleged corruption and crackdowns on media independence.