Tens of thousands of people have protested in the capital of Poland against a new law that allows parliament to appoint supreme court judges and defies a European Union warning that the move undermines democracy and the rule of law.
Police said 14,000 people participated in Thursday's demonstration, while city officials claimed the number was up to 50,000.
The bill, sponsored by the ruling Law and Justice party (PiS), was passed by parliament's lower house earlier in the day after tumultuous debate, triggering one of the biggest protests since the PiS came to power in late 2015.
It calls for replacing all supreme court judges except those elected by a judicial panel that is to be chosen by the parliament. The supreme court's tasks include validating elections.
Thursday's vote came a day after the European Union gave its largest formerly communist member state a week to shelve judicial reforms that Brussels said would put courts under direct government control.
If Warsaw's nationalist-minded PiS does not back down, the government could face fines and even a suspension of voting rights, although other eurosceptics in the EU, notably Hungary, will likely veto strict punishment.
In the best-case scenario, Poland will see its clout in Brussels wane further. It has already been damaged by mounting frustration among its EU peers arising from bitter disputes over issues such as migrant quotas and nature conservation.
"We will ... not allow them to trample European values," Wladyslaw Kosiniak-Kamysz, leader of the Polish People's Party (PSL), told a crowd in Warsaw. "We will not allow ourselves to be pushed out of the European Union."
A crowd in front of the Presidential Palace, carrying Polish and EU flags responded by chanting, "Free Poland, European!" "Free Poland, European!"
Sources close to the Presidential Palace told Reuters news agency that President Andrzej Duda was on holiday on the Baltic coast.
Tens of thousands also demonstrated in other Polish cities.
"I wanted to be here on this historic day when our freedoms for which we fought for more than 25 years are being taken away," said Piotr, 48, who came to the protests in Warsaw with his five-year-old son.
The government says the changes are needed to make courts accountable and to ensure state institutions serve all Poles, not just the "elites" that it says are the support base for the centrist opposition.
PiS has offered no concessions, instead presenting the EU criticism as unacceptable foreign meddling in the domestic affairs of the country, which overthrew communism in 1989 and joined the EU in 2004.
"We will not give into pressure," Prime Minister Beata Szydlo said on Thursday evening in a special state television address defending the bill. "We will not be intimidated by Polish and foreign defenders of the interests of the elite."
Rift with the EU
The bill will go to parliament's upper house on Friday, where PiS has an absolute majority. President Duda, a PiS ally, will have to sign it before it can become law.
Critics at home and abroad say the legislation is part of a drift towards authoritarianism by the government, which espouses nationalist rhetoric coupled with left-leaning economic policy.
Since being elected in 2015, PiS has tightened government control over courts and prosecutors, as well as state media, and introduced restrictions on public gatherings and the activity of non-governmental organisations.
Last week, parliament passed another bill that ends the terms of current members of the National Council of the Judiciary, one of the main judicial bodies, and gives parliament the power to choose 15 of its 25 members.
Political opponents, rights groups and the EU have said the changes undermine the separation of powers between the executive and the judiciary, a fundamental democratic principle.
While PiS remains broadly popular among many Poles, particularly poorer and older voters from the countryside, there have been widespread protests against the plans.
European Council President Donald Tusk, a former Polish centrist prime minister and arch-adversary of PiS, said on Thursday that he had asked Duda for an urgent meeting about the "political crisis" in the country.
Tusk said in a statement that the PiS moves on courts were backwards, went "against European standards and values", harmed Poland's reputation and risked marginalising the country.
"The European Union is not only money and procedures. It is first and foremost values and high standards of public life. That is why a wave of criticism of the government is rising in Europe and in the whole West," Tusk said.
A senior aide to Duda, Krzysztof Szczerski, said Tusk should instead focus on explaining Poland's stance in Brussels.
"The president is surprised that there has been such increased engagement in this matter by European institutions because everything is in accordance with the Polish legal order," Szczerski told Reuters in an emailed statement.
Source: News agencies