Former U.S. President Barack Obama said on Tuesday that President Donald Trump's decision to withdraw from the Iran nuclear deal, struck during Obama's presidency, was "misguided."

"I believe that the decision to put the JCPOA at risk without any Iranian violation of the deal is a serious mistake," Obama said in a statement, referring to the acronym for the agreement worked out by the United States, five other world powers and Iran.

Since leaving office in January 2017, Obama, a Democrat, has largely remained on the sidelines of the political debate, although he has criticized his Republican successor's efforts to undo some of his major policy achievements.

He has condemned Trump for pulling out of the Paris climate accord and for ending a program that shielded from deportation immigrants brought to the United States illegally as children. He also spoke out against Trump's effort to unravel the Obamacare health care program.

Obama said the Iran agreement significantly rolled back Tehran's nuclear program and was a model for a possible deal Trump hopes to negotiate with North Korea to eliminate Pyongyang's nuclear weapons.

"That is why today's announcement is so misguided," Obama said.

"Walking away from the JCPOA turns our back on America's closest allies, and an agreement that our country's leading diplomats, scientists, and intelligence professionals negotiated," he said.