Polish Opposition Leader Donald Tusk declared the beginning of a new era for his country after opposition parties appeared to have won enough votes in Sunday's parliamentary election to oust the governing nationalist conservative party, the Law and Justice party (PiS).
"I have been a politician for many years. I’m an athlete. Never in my life have I been so happy about taking seemingly second place. Poland won. Democracy has won. We have removed them from power," Mr Tusk told his cheering supporters.
"This result might still be better, but already today we can say this is the end of the bad time, this is end of Law and Justice rule."
So why was this election so important, who is Donald Tusk and what does the result mean for their alliance with Ukraine?
What was the result?
If the result predicted by an exit poll holds, Law and Justice won but also lost.
It got more seats than any other party but not enough to be able to lead a government that can pass laws in the legislature.
It also showed three opposition parties have likely won a combined 248 seats in the 460-seat lower house of parliament, the Sejm.
The largest of the groups is Civic Coalition, led by Mr Tusk which won 31.6 per cent of votes, the exit poll said.
The Ipsos exit poll suggested that Law and Justice obtained 200 seats. Its potential partner, the far-right Confederation party got 12 seats, a showing the party acknowledged was a defeat.
Law and Justice leader Jaroslaw Kaczynski acknowledged the ambiguous result. He told supporters at his headquarters that his party’s result, at nearly 37 per cent of the vote, according to the exit poll, was a success, making it the party to win the most votes for three parliamentary elections in a row.
Civic Coalition, Third Way and the New Left all ran on separate tickets but with the same promises of seeking to oust Law and Justice and restore good ties with the European Union.
The three parties will likely join together to form a majority government. Votes were still being counted and the state electoral commission says it expects to have final results by Tuesday morning.
Why was this election significant?
During the campaign many Poles described the vote as the most important one since 1989, when a new democracy was born after decades of communism.
Turnout Sunday appeared to be even higher than the 63 per cent of voters who turned out for the 1989 election.
In some places people were still in line when polling officially closed, but all were allowed to vote.
Prior to the vote, Mr Tusk said the election was about Poland's future in the EU.
The Law and Justice government said it has no plans to bring Poland out of the EU, just reduce Brussels' influence on the member countries.
It has alleged that if Mr Tusk's coalition takes power, Poland will be flooded with migrants, which they rejected as scaremongering.
How will this affect Poland's support for Ukraine?
The fate of Poland's relationship with Ukraine was also at stake.
While all parties were in favour of remaining in NATO, which Poland views as a vital security guarantee against Russia, the stances on Ukraine differ.
Poland is a neighbour to both Ukraine and Belarus — with Belarus an ally of Russia in the war against Ukraine.
In August this year Poland accused Belarus of violating its airspace, before sending 10,000 troops to the border.
Law and Justice's nationalist policies have also harmed Poland's relations with Ukraine.
While Poland has been a staunch ally of Ukraine since Russia invaded and a transit hub for Western weapons, relations chilled over the Ukrainian grain that entered Poland's market.
With tensions rising, and as the Confederation party's numbers grew, Poland's prime minister said his country was no longer sending weapons to Kyiv — this is despite being the first NATO member to send Ukraine weapons.
The Confederation party campaigned on an anti-Ukraine message, accusing the country of lacking gratitude to Poland for its help in Russia's war. Its poor showing will be a relief for Kyiv.
Who is Donald Tusk?
Donald Tusk was a former prime minister and a former European Union president.
Mr Tusk was the first Polish prime minister to serve two consecutive terms, from 2007 to 2014, after the fall of communism in 1989.
During his terms as prime minister, Mr Tusk's Civic Platform party formed a coalition with the Polish Peasant's Party where he worked to repair relationships with Germany and Russia following World War II.
He also implemented pro-business and pro-European Union policies which were believed to have benefited the country during the Global Financial Crisis in 2008-2009.
His popularity waned during his second term after increasing the retirement age to 67 and a number of scandals hit the party — including his son Michael Tusk being found to be in the middle of a wide-spread Ponzi scheme.
Following his tenure as prime minister, Mr Tusk was elected as European Union president in August 2014.
Challenges during his time at the EU included Russia's annexation of Crimea in 2014 and Britain deciding to leave the EU in 2016.
He left the EU in 2021 to become leader of the Civic Platform party.
Mr Tusk has vowed to restore the rule of law and to rebuild ties with the EU that became severely strained under Law and Justice.
How long was the Law and Justice party in power?
The right-wing party governed Poland since 2015.
It is led by deputy prime minister Jaroslaw Kaczynski, 74, the country's most powerful politician.
Since taking power, the conservative nationalist party has tightened Poland's abortion laws and built a wall on the border with Belarus intended to stop irregular migration. It vows to continue its anti-migration policy and to oppose EU plans on sharing out responsibility for migrants.
The government has also clashed with the EU over violations of democratic principles, leading to the freezing of billions of euros of pandemic recovery funds intended for Poland. Law and Justice wants less EU authority in the 27 member countries.
It has boosted military spending and been a strong supporter of Ukraine after the full-scale Russian invasion, though the relationship has been strained recently.
The government gained popularity for cash benefits for families and retirees and had vowed to expand those programs if re-elected.
Earlier in the year, almost half a million Poles took to the streets of Warsaw to protest the PiS party saying the party was reversing many of the achievements made since Poland emerged from communist rule in 1989.
What else were they voting for?
A referendum with four questions was held in parallel with the parliamentary vote.
Voters were being asked their views on whether to accept migrants, keep a new wall on the border with Belarus, raise the retirement age and sell off state assets.
More than 50 per cent of eligible voters need to take part to make the referendum legally binding.
Some government opponents called on voters to boycott the referendum, saying it was an attempt by the government to galvanise its supporters.
Many voters were seen refusing to take part in the referendum.
Voting is not compulsory in Poland.