Calling it “decaying and rotten”, he said the deal was “an embarrassment” to him “as a citizen”.
He said he would reimpose economic sanctions that were waived when the deal was signed in 2015.
The move goes against advice from his European allies and some military advisers.
In a statement, France, Germany and the UK – who are also signatories to the deal – have said they “regret” the American decision.
But Israel’s Prime Minister Benjamin Netanyahu says he “fully supports” the “bold” withdrawal.
The so-called Joint Comprehensive Plan of Action (JCPOA) saw Iran agree to limit the size of its stockpile of enriched uranium – which is used to make reactor fuel, but also nuclear weapons – for 15 years and the number of centrifuges installed to enrich uranium for 10 years.
Iran also agreed to modify a heavy water facility so it could not produce plutonium suitable for a bomb.