Polish lawmakers approved a new law on Friday that the government hopes will appease the European Union and release billions of euros in funding.
The law, which could unfreeze a 35 billion Covid recovery fund from Brussels, aims to improve accountability in the judiciary.
Brussels and Warsaw have been at loggerheads for years over the ruling Justice and Development party's (PiS) reforms of the judicial system, which the EU claims undermine the country's democracy, alongside its rollback of media freedoms.
Poland has been blocked from accessing EU aid by Brussels until it makes essential changes.
The right-wing coalition government says that the new law has been agreed on with officials in Brussels and should lead to the much-needed billion-euro pot being released.
Previous changes made by Poland did not go far enough for the EU.
But the justice minister, who introduced the measures to increase political control over judges, opposes the changes. He threatened the government's future, while President Andrzej Duda said he had not been consulted on the new law.
An upcoming general election in the autumn has given weight to the matter.
Surveys suggest that the governing coalition might lose control of the parliament, meaning the government is seeking to obtain the EU funds, hoping to boost support from voters.
The lower house of parliament voted 203-52 to approve the legislation, with 189 abstentions, reflecting divisions inside the ruling coalition and the opposition's scepticism.
The head of an opposition party, Władysław Kosiniak-Kamysz, was among those who abstained.
“This bill doesn't restore the rule of law," he said before the vote in parliament. "That will only be possible after we [the opposition] win the elections.”
“But if this bill is a chance for the unblocking of the European funds, it is really important,” Kosiniak-Kamysz added
It was not immediately clear if the EU would be satisfied with the changes, but a European Commission spokesman told Polish state news agency PAP that the law was an important step towards meeting EU criteria.
“We will continue to follow closely the next steps of the ongoing adoption process and then review the final law adopted,” Christian Wigand told PAP.