Polish President Bronislaw Komorowski was pushed into a surprise second place spot by a conservative challenger in the presidential election.
He must now face him in a run-off on 24 May, an exit poll showed.
No official results from the voting have been released.
The exit poll by Ipsos, put Mr Komorowski on 32.2% of the vote, behind conservative Andrzej Duda on 34.8%.
Pawel Kukiz, a rock musician, was third on 20.3%, the exit poll showed.
Opinion polls before the vote had shown Mr Komorowski with a comfortable lead.
In Poland, the prime minister has the most powers, but the president wields clout as head of the armed forces, has a say in foreign policy and the power to veto legislation.
Polls give Mr Komorowski around 40% support.
His closest rival, Mr Duda, has about 30%, after closing the gap on Mr Komorowski in the past few weeks.
The third most popular candidate, on about 15%, is Mr Kukiz, a former rock musician who has picked up support from Poles who are disenchanted with mainstream politics.
A comfortable re-election for Mr Komorowski would give a confidence boost to his allies in the centre-right Polish government, who face what will be a tightly fought race for another term later this year.
Mr Komorowski has stressed in his campaign that he is a safe pair of hands on national security.
That message has played well with voters nervous that after Russia's intervention in Ukraine, who fear Poland could become the next target.
Mr Duda, backed by the conservative opposition Law and Justice party, has promised that he would lower the retirement age if elected.
He has also warned that if Poland adopts the euro - something Mr Komorowski is in favour of - prices of goods in shops will shoot up.
Mr Duda arrived at the polling station in his hometown, Krakow, with his wife and daughter.
Polish Prime Minister Ewa Kopacz voted in the city of Radom.
Mr Kopacz's party Civic Platform supports Mr Komorowski, who has decided to run as an independent candidate in the election.
Former president and icon of Poland's Solidarnosc movement, Lech Walesa, cast his vote in Gdansk in front of a crowd of photographers - each asking him to turn in their direction.
Mr Walesa jokingly turned around in a full circle.
If no candidate receives more than 50% of the votes, the two with the largest number of votes will compete in a second round on 24 May.