The re-election of government ally Duda, who would now face liberal Warsaw mayor Rafal Trzaskowski in a run-off, is crucial if ruling nationalists Law and Justice (PiS) are to implement their conservative agenda, including reforms the EU says undermine the independence of the judiciary.
The president has the right to veto laws and Trzaskowski, the candidate of the largest opposition party, the centrist Civic Platform (PO), has vowed to stop reforms which he says erode democracy.
"I want to thank everyone for voting," Duda told supporters after the exit poll was released.
Final voting results from the first round are expected later in the week.
Duda got 41.8% of the votes, the exit poll showed, while Trzaskowski came second with 30.4%. With none of the 11 candidates scoring more than 50% in the first round, the run-off between the two frontrunners will take place on July 12.