– Legal chaos has deepened dramatically in Poland, with the government and the country's high court judges clashing over who administers justice — a rift that some experts say is an assault on the young democracy and could lead to a break from the European Union.

The right-wing populist governing party has tried to take control of Poland's court system ever since it won power in 2015, steadily eroding the courts' independence from politics.

The party took two major steps Thursday toward assuming full sway over the legal system: passing legislation that allows the government to fire judges whose rulings it does not like and expressing open defiance of a Supreme Court resolution that condemned some judges' appointments as illegitimate.

The European Union expressed its deep concerns Friday as Poland's government continues to defy the laws and standards that it agreed to uphold when it joined in 2004.

Some European legal scholars warn that the developments threaten the entire E.U. legal system. Courts in the 28 E.U. member countries recognize the decisions of courts in the other nations on topics ranging from European arrest warrants to child custody issues and commercial law.

But as Poland's court system becomes increasingly politicized, there are fears that Polish judges will no longer operate as objective arbitrators and will face pressure to issue rulings to the government's liking.

In a resolution, 60 members of the Supreme Court, which largely has managed to maintain independence from the government, said judges are illegitimate if appointed by a judiciary council that the ruling party has politicized.

Several courts canceled some hearings Friday because of uncertainty over whether some judges had the authority to make rulings.

The high court says the judiciary council is illegitimate because its members are appointed by the government, violating judicial independence. The E.U.'s top court, the European Court of Justice, has warned that the new judicial body could have that effect.

Also Thursday, the lower house of Parliament passed legislation allowing politicians to fire judges who rule against the government, even if they adhere to E.U. law.

The so-called "muzzle law" has been condemned by the E.U., the United Nations and the Council of Europe, the continent's largest human rights body. Amnesty International has said the law would end the separation of powers in Poland.

Polish constitutional expert Bogna Baczynska said the E.U. legal framework ensures that citizens in all member states are guaranteed equal rights, and a breach by a member country breaks the common foundation.

The legislation goes next to President Andrzej Duda, who is expected to sign it. He argued that the justice system is deeply flawed and needs reform. He also asserted that the E.U. does not have the right to dictate to Poland how to run its justice system.

"We will not be told, in foreign languages, what kind of system we should have in Poland and how Poland's affairs should be taken care of," Duda said.