The head of Poland's Supreme Court has vowed to defy a controversial new law forcing her and dozens of senior judges to retire early.

Chief Justice Prof Malgorzata Gersdorf was told she had to step down on Tuesday, in line with new legislation.

But a spokesman for the Supreme Court said she would go to work as normal on Wednesday.

Prof Gersdorf earlier branded the reforms, which require judges to retire at 65 instead of 70, a "purge".

Under the new legislation, up to 40% of Supreme Court judges are expected to be forced out.

On Monday the European Union launched legal action against Poland's right-wing government, saying the law undermined judicial independence.

But the government says the changes will help fight corruption and improve the court's efficiency.

What is the row about?
The new law imposes a new retirement age for judges of 65. Presidential assent is required for those who wish to stay on. Judges had until Tuesday to apply to stay on.

Prof Gersdorf, alongside other Supreme Court colleagues, had previously refused to make such an appeal.

The judge, an outspoken critic of the governing Law and Justice (PiS) party, has insisted that under Poland's constitution she should remain in her post until 2020.

She has called the government's move "a purge of the Supreme Court conducted under the guise of retirement reform".

Prof Gersdorf, who is already 65, met President Andrzej Duda on Tuesday. Despite her opposition, a presidential aide later said that she would be forced into retirement from midnight and replaced by a judge appointed by Mr Duda, an ally of PiS.

But Supreme Court spokesman Michal Laskowski remained defiant.

"Plans have not changed here, Mrs Gersdorf intends to come to work tomorrow," he told reporters.

Protests in support of Prof Gersdorf and other defiant judges are expected to take place on Wednesday around the Supreme Court building in the capital, Warsaw.

What is the EU's objection?
Poland insists its reforms are aimed at updating an inefficient system and replacing judges who date back to a communist era that collapsed in 1989.

However, the EU complains that judges have no way of seeking a review if their request to the president is turned down.

The head of state also does not have to explain any reasons for making such a decision.

The EU's executive, the European Commission, has given Poland a month - rather than the standard two months - to respond to the legal challenge.

Polish Foreign Minister Jacek Czaputowicz said the law was binding and "for the time being our stance is that we are right".