The European Union warned Hungary on Tuesday that emergency measures adopted by its nationalist government to fight the coronavirus crisis must not undercut democracy.

Hungary's parliament on Monday granted Prime Minister Viktor Orban an open-ended right to rule by decree and introduced jail sentences for anyone hindering measures to curb the spread of the virus or spreading false information about the pandemic.

More:

"It is of utmost importance that emergency measures are not at the expense of our fundamental principles and values ... democracy cannot work without free and independent media," said European Commission President Ursula von der Leyen.

"Any emergency measures must be limited to what is necessary and strictly proportionate. They must not last indefinitely ... governments must make sure that such measures are subject to regular scrutiny," she said in a statement.

The Commission, the EU's executive body, said it would analyse Hungary's law and monitor its implementation. Hungary has already raised the Commission's hackles by expanding state control over the media, academics and rights groups.

Orban, a fierce nationalist who has gradually strengthened his power over a decade in office, has used legal levers, ownership changes and advertising money to create more loyal media coverage.

Hungarian government spokesman Zoltan Kovacs said the law was "congruent with the [EU] treaties and Hungarian constitution, and targeted exclusively at fighting the coronavirus.

"It upholds EU values, rule of law, press freedom," he tweeted in response to the Commission's comments.

In Hungary's eurosceptic ally Poland, the government has already restricted movement and economic activity through executive decrees.

It could have declared a legal "state of natural disaster" but this might have called into question a presidential election being held on May 10, in which the incumbent, allied to the ruling Law and Justice (PiS) party, leads in the opinion polls.

Both Poland and Hungary - formerly communist countries on the EU's eastern flank - are involved in running battles with Brussels, which accuses them of undermining the EU's basic democratic principles.

Liberal EU legislators from the Renew Europe faction allied to French President Emmanuel Macron derided the bloc's failure to safeguard checks and balances in Hungary after years of tussles that have mostly failed to make Orban change tack.

"The current coronavirus crisis should not be used as a smokescreen for abusing power," said Dacian Ciolos, a Romanian member of the European Parliament and the head of the Renew faction.