Polish elections: When are they and why is Europe watching closely?
Poles will vote next Sunday in what opposition leader Donald Tusk has billed as their "most important election since 1989 and the fall of communism".
The populist, right-wing United Right coalition, led by the Law and Justice party is seeking a third term in office, unprecedented in Poland since 1989.
But after an intensely bitter election campaign, the gap between the right and centre has narrowed, ahead of the 15 October vote for the Sejm (lower house of parliament) and the Senate.
Poland has been a staunch supporter of Ukraine since Russia's full-scale invasion began, but relations have frayed during the campaign over a Polish ban on Ukrainian grain.
Warsaw has also pursued a confrontational approach towards the EU and been accused of undermining democratic standards. "We are not afraid of diktats... from Berlin and Brussels," says Prime Minister Mateusz Morawiecki.
Who is fighting the election?
The ruling party, in office since 2015 and led by Jaroslaw Kaczynski, is ahead in the polls but may struggle to form a coalition to win an outright majority.
Donald Tusk's party leads the centrist Civic Coalition (KO), but he has been unable to unite with two other moderate parties, the Third Way and The Left.
"A big change is coming. This is a sign of Poland's rebirth," he told a crowd of supporters running into the hundreds of thousands in the run-up to the vote.
A former prime minister of Poland from 2007-14, he later became president of the European Council. The current prime minister, Mateusz Morawiecki, accused him of following orders from Brussels and Berlin, particularly on taking in migrants.
The far-right Confederation party - Konfederacja in Polish - could play a crucial role in getting Law and Justice enough seats to stay in power.
What are the big election issues?
Migration has become one of the most contentious issues ahead of the vote.
Law and Justice have stepped up anti-migrant rhetoric, warning that the EU and the opposition want to force Muslim migrants on an overwhelmingly Roman Catholic country. The government has refused to take in asylum-seekers who enter the EU in other countries.
In a campaign ad, Mr Kaczynski tells voters: "Do you want us to stop being masters of our own country? Read my lips: Poles do not want this and Law and Justice does not want any of this, either."
But the opposition has accused the ruling party of hypocrisy, because it has presided over the largest immigration wave in recent times. It has also highlighted allegations that EU border-free Schengen visas were handed out at Polish consulates in the Middle East and Africa in exchange for bribes. The EU says it is still waiting for clarity from Warsaw on what happened.
The war in Ukraine has also played a key role in the campaign.
Poland has provided Ukraine with more than $3bn in arms. However, amid tensions over Ukraine's grain exports, Prime Minister Mateusz Morawiecki said last month it would supply no more weapons, and was focusing on rebuilding its own depleted stocks.
More than a million Ukrainian refugees are living in Poland, which welcomed them in the early months of Russia's full-scale invasion with open arms.
But as the campaign became increasingly heated, the government indicated that Ukraine was showing a lack of gratitude and President Andrzej Duda compared his neighbour to a sinking person dragging a rescuer to the bottom.
Far-right Konfederacja is the only party to oppose Ukrainian immigration and has criticised the government's decision to award refugees benefits.
At heart the PiS is a socially conservative party and, in the lead-up to the election, it emphasised its Catholic family values, passing into law a 60% increase in child support payments to 800 Zloty (£150) a month.
It has more than doubled the minimum wage between 2015 and January next year and handed out free prescription medicines for the young and old.
More than 10 million pensioners, too, are in line for bonuses - a significant element of Poland's electorate.
But the party has faced anger over the 2020 tightening of abortion laws, which closed "almost all avenues to having a legal abortion", according to Agnieszka Kubal of University College London.
It has also been accused of politicising the judiciary by capturing the body that nominates judges in Poland, staffing the Constitutional Tribunal and Supreme Court with sympathetic judges, and bringing in rules to punish judges who criticised government reforms.
The European Commission said Poland's code for punishing judges broke EU law, and the EU's Court of Justice fined the government a record €1m a day, until the Court ruled in June that Poland had indeed violated the bloc's rules.
PiS insists its reforms were intended to speed up lengthy trial proceedings and route out judicial corruption, but the EU has withheld €36bn (£30bn) of Covid pandemic recovery funds until the changes are reversed.
Donald Tusk has promised to unblock EU funds immediately, if he gets into power. He pointed out that Poland was the only country that was yet to benefit from the recovery money.
He has also warned that PiS could pull Poland out of the EU, which the ruling party denies.
The results of the election could have a big impact on relations with the EU.
"Tusk says he would reverse the judicial changes on day one, if he wins," says Agnieszka Kubal. "But under the Law and Justice party, with their tactics and policies, we might reach a point of no return with the EU."
Not just a general election
Apart from voting on the next government, Poles have also been given four questions to vote on in a referendum, in an apparent attempt to encourage more of its electorate to vote. All four questions have been drawn up to expect the answer no and ask whether:
- state companies should be privatised
- the retirement age should increase
- a fence with Belarus should be dismantled
- Poland should accept more migrants from the rest of the EU
PiS opposes all these measures, while the opposition is not planning to pursue any of the policies.
Opposition parties say the questions are worded in a biased way, and say voters should boycott the referendum.