Former President Barack Obama is calling President Trump's decision to pull the U.S. out of the 2015 Iran nuclear deal a "serious mistake" and said walking away from it "turns our back on America's closest allies."

"The reality is clear. The JCPOA is working -- that is a view shared by our European allies, independent experts, and the current U.S. Secretary of Defense," Obama said in a statement Tuesday, referring to the agreement's title, the Joint Comprehensive Plan of Action. "The JCPOA is in America's interest -- it has significantly rolled back Iran's nuclear program. And the JCPOA is a model for what diplomacy can accomplish -- its inspections and verification regime is precisely what the United States should be working to put in place with North Korea."

Obama released the statement following Mr. Trump's announcement Tuesday that the U.S. will withdraw from the nuclear agreement, which the Obama administration reached in 2015 between the U.S., Russia, China, Iran and three European nations -- France, Germany and Britain. The agreement, the cornerstone of Obama's foreign policy legacy, lifted most international and U.S. sanctions that were on Iran in exchange for the country agreeing to restrictions on its nuclear program and inspections to enforce compliance.

Mr. Trump slammed the agreement Tuesday as "a horrible, one-sided deal" and called it "defective at its core." Citing intelligence about Iran's past nuclear activities that Israel unveiled last week, Mr. Trump claimed there is "definitive" proof Iran violated the deal, but he didn't elaborate on that assertion.

Get Breaking News Delivered to Your Inbox

Without mentioning Mr. Trump by name, Obama called Mr. Trump's announcement on the deal "so misguided" and said that Iran is complying with the agreement.

"That was not simply the view of my Administration," Obama said. "The United States intelligence community has continued to find that Iran is meeting its responsibilities under the deal, and has reported as much to Congress. So have our closest allies, and the international agency responsible for verifying Iranian compliance -- the International Atomic Energy Agency (IAEA)."

Obama said the U.S. could "eventually be left with a losing choice between a nuclear-armed Iran or another war in the Middle East" without the deal.

"We all know the dangers of Iran obtaining a nuclear weapon," he said. "It could embolden an already dangerous regime; threaten our friends with destruction; pose unacceptable dangers to America's own security; and trigger an arms race in the world's most dangerous region," he said. "If the constraints on Iran's nuclear program under the JCPOA are lost, we could be hastening the day when we are faced with the choice between living with that threat, or going to war to prevent it."

He also said that "the consistent flouting of agreements that our country is a party to risks eroding America's credibility, and puts us at odds with the world's major powers."

Ian Bremmer, president and founder of Eurasia Group, echoed concerns about what the decision means for the U.S.' relationships with key allies. He said the biggest concern in the near term is that the U.S. has damaged its credibility with France, Germany and the United Kingdom -- all parties to the nuclear agreement.

"We've basically been telling these allies that their opinions don't really matter," Bremmer said.

German Chancellor Angela Merkel and French President Emmanuel Macron both recently traveled to the U.S. to meet with Mr. Trump. Their single most important message to him was: Do not unilaterally leave the Iranian deal, according to Bremmer, and that we don't have a plan B. But Mr. Trump did it anyway.

"The willingness of those countries to work with us going forward, the willingness to go their own way on broader security issues, on things like technology, on the markets, on economic trade -- they're not seeing the United State as an ally they can really count on," Bremmer said.

"And I think that really hurts when you have a country like China that's spending an awful lot of money, that's doing really well. That seems strategic … What worries me the most is the broader unwind," he said.

Macron tweeted Tuesday that "France, Germany, and the UK regret the U.S. decision to leave the JCPOA."

France, Germany, and the UK regret the U.S. decision to leave the JCPOA. The nuclear non-proliferation regime is at stake. — Emmanuel Macron (@EmmanuelMacron) May 8, 2018

Meanwhile, Israeli Prime Minister Benjamin Netanyahu, who has been a leading critic of the deal, hailed Tuesday's move as "historic."

"The deal didn't reduce Iran's aggression, it dramatically increased it, and we see this across the entire Middle East," he said according to The Associated Press. "Despite the deal, the terrorist regime in Tehran is developing a ballistic missiles capability, ballistic missiles to carry nuclear warheads far and wide, to many parts of the world."