Image source, Getty ImagesImage caption, Poland's Prime Minister, Mateusz Morawiecki (R), said his country had been attacked in an "unjust" way

Polish Prime Minister Mateusz Morawiecki has accused the EU of "blackmail" in a heated debate with European Commission chief Ursula von der Leyen over the rule of law.

The clash in the European Parliament follows a top Polish court ruling that rejected key parts of EU law.

Mrs von der Leyen said she would act to prevent Poland undermining EU values.

In response, Mr Morawiecki rejected "the language of threats" and accused the EU of overstepping its powers.

"Blackmail must not be a method of policy," Mr Morawiecki of Poland's ruling conservative-nationalist Law and Justice party told the European Parliament.

Tuesday's debate covered an unprecedented and controversial ruling this month by Poland's Constitutional Tribunal that in effect rejected the core principle that EU law has primacy over the national legislation of member states.

The case, brought by the Polish prime minister, was the first time that an EU member state's leader had questioned EU treaties in a national constitutional court.

The head of the European Commission said the situation had to be resolved but she was adamant: "This ruling calls into question the foundations of the European Union. It is a direct challenge to the unity of the European legal order."

The ruling has raised concerns that Poland – like the UK – could exit the EU in a so-called Polexit. But Mr Morawiecki has repeatedly insisted the country has no plans to leave the union.

"We should not be spreading lies about Polish Polexit," he told the European Parliament.

  • ANALYSIS: Polish court ruling stokes fears of Polexit

Opinion polls consistently show strong backing for EU membership among Polish voters. Mass protests have been held by Poles who back remaining a member.

But in recent years, Poland's right-wing populist government has found itself increasingly at odds with the European Commission over issues ranging from LGBT rights to judicial independence.