Justice Minister Adam Bodnar has been tasked with unpicking policies of the previous nationalist Law and Justice (PiS) government which critics say increased political influence over the judicial system.

Rolling back the PiS reforms is crucial if Poland is to unblock billions of euros in European Union funding that have been frozen over rule-of-law concerns.

However, it brings the new pro-European government into conflict with President Andrzej Duda, a PiS ally, in a turbulent first few weeks of "cohabitation".

The president says Bodnar does not have the authority to unilaterally dismiss Barski. The justice ministry argues that Barski's appointment was invalid, as laws in force at the time of his appointment barred somebody who had retired from taking up the role of state prosecutor.

"The dismissal of the state prosecutor may only take place after consultation between the prime minister and the president... it requires the president's written consent," Duda told reporters after a meeting with Prime Minister Donald Tusk.

"There is no doubt that the law was broken here... it is absolutely impossible to talk about any effective removal of the state prosecutor from his position."

During PiS's time in office some prosecutors complained of undue political influence on their work. Those who carried out the party's wishes advanced quickly in their careers, while PiS opponents said they were penalised.

PiS said its reforms were intended to sweep away the distortions and inefficiencies left from communist rule.

Bodnar told reporters on Monday that he wanted the new state prosecutor to be someone who "enjoys absolute authority, respect from all legal circles and will guarantee the proper functioning of the prosecutor's office in the future."

(Reporting by Alan Charlish and Anna Koper; Editing by Ros Russell and Andrew Cawthorne)

By Alan Charlish and Anna Koper