An exit poll projected Poland's ruling nationalist Law and Justice (PiS) party would win today's parliamentary election with 43.6% of the vote.

The opposition Civic Coalition, comprising the Civic Platform (PO) party formerly led by European Council President Donald Tusk and some smaller liberal parties, came second with 27.4%, according to the Ipsos poll.

An overall majority in the lower house of parliament would give PiS a strong mandate to continue its controversial reforms of the justice system, media, cultural institutions, banking and the energy sector.

Poland's Jaroslaw Kaczynski, head of the ruling nationalist party, declared victory in the election tonight.

The party had cast the election as a choice between a society rooted in traditional Catholic values and a liberal order that promotes a chosen few and undermines family life.

Opposition parties and Poland's European Union partners had said the outgoing government has undermined the independence of the judiciary and the media and made Poland less welcoming for sexual and ethnic minorities.

"We can guarantee that Polish families are protected, that Poland's freedom is protected and that the Polish Church is protected against attacks," Mr Kaczynski told supporters in its eastern rural heartland on Friday.

Polling around 19-26%, the centrist Civic Coalition - an umbrella group that includes the Civic Platform formerly led by EU Council president Donald Tusk - looks certain to continue forming the main opposition.

Its candidate for prime minister, Malgorzata Kidawa-Blonska, on Thursday accused Mr Kaczynski of destroying democracy and seeking to sow further divisions.

"He is building a huge wall and creating great tensions," she told supporters.

"That is why I call on all people of good will ... regardless of their political views: let's defend Poland against such ... hatred."

One of the foundations of the PiS' success is the way it has tapped into anger among the poorer Poles who had missed out on prosperity since the collapse of communism in 1989, mixing nationalist rhetoric with a vast welfare programme that an economic boom has allowed it to implement.

It has drawn on the deeply rooted popularity of the Catholic Church. Top PiS officials regularly attend Church events and the party has espoused stronger religious values in public life.

The Church does not openly back any party but senior officials have given the PiS tacit support.

On 1 October, Poland's senior bishop wrote that Catholics should vote for those to defend the right to life from conception, support family values and define marriage as between man and a woman.

During campaigning, PiS has called lesbian, gay, bisexual and transgender (LGBT) rights an invasive foreign influence that threatens Poland's national identity.

The party has also shifted Poland's foreign policy away from the European mainstream, becoming a leading proponent of calls to take some powers away from the EU, with which Warsaw is embroiled in a long-running row over judicial and media reforms.

Brussels has taken legal action to force Polish authorities to row back on legislation it says has politicised the courts.

PiS says the reforms are needed to make the court system fairer and more efficient and plans further changes if it is re-elected.

"A lack of independent courts is not part of the Polish tradition," Ms Kidawa-Blonska said on Friday.

PiS has also sought closer ties with US President Donald Trump, with whom it shares views on coal mining, climate and abortion, fuelling concern among some western EU diplomats that Mr Trump could use the biggest of the EU's ex-communist states to sow discord over issues such as Iran.