"I have decided to send back to parliament -- therefore, to veto -- the law on the Supreme Court, as well as the law on the National Council of the Judiciary," Duda said in a televised declaration.
"This law would not strengthen the sense of justice" in society, he said, adding that his decision followed extensive consultations with legal experts over the weekend.
"These laws must be amended," Duda said.
The reforms would have increased political control over the judiciary, sparking an outcry amongst critics who said the ruling rightwing Law and Justice (PiS) party was seeking to reduce the independence of the courts.
More From This Section
The role of attorney general is held by the justice minister in Poland, and the change was among reforms that had sparked concern over the rule of law.
The Polish senate had on Saturday backed the reforms, but they had still needed the president's sign-off.
But Monday's veto was a surprise as Duda is closely allied with the PiS.
Thousands of protesters had taken to the streets across Poland in recent days to oppose the bill, including huge crowds who held a candlelit protest outside the Supreme Court on Sunday night urging Duda to veto the changes.
The government had defended the reforms, calling them indispensable to combat corruption and streamline the judicial system.
The PiS, which began making changes to the judiciary after coming to power in late 2015, has argued resistance to the initiatives is a case of the elite defending their privileges.
Under the current system, candidates for the Supreme Court are selected by an independent body consisting mainly of judges but also a few politicians.