Calling it “decaying and rotten”, he said the deal was “an embarrassment” to him “as a citizen”.
Going against advice from European allies, he said he would reimpose economic sanctions that were waived when the deal was signed in 2015, BBC reports.
In response, Iran said it was preparing to restart uranium enrichment, key for making both nuclear energy and weapons.
Iran’s President Hassan Rouhani said: “The US has announced that it doesn’t respect its commitments.
“I have ordered the Atomic Energy Organisation of Iran to be ready to start the enrichment of uranium at industrial levels.”
He said he would “wait a few weeks” to speak to allies and those who were committed to the nuclear deal.
“All depends on our national interests,” he said.
In a statement, France, Germany and the UK – who are also signatories to the deal – have said they “regret” the American decision.
The European Union’s top diplomat, Federica Mogherini, said the EU was “determined to preserve” the deal.
But Israel’s Prime Minister Benjamin Netanyahu says he “fully supports” Mr Trump’s “bold” withdrawal from a “disastrous” deal.
Mr Trump had previously complained that the deal only limited Iran’s nuclear activities for a fixed period; had failed to stop the development of ballistic missiles; and had handed Iran a $100bn (£74bn) windfall that it used “as a slush fund for weapons, terror, and oppression” across the Middle East.