President Trump on Tuesday pulled the US out of the Iranian nuclear deal — declaring that “America will not be held hostage to nuclear blackmail” — despite warnings that withdrawal could make it easier for the regime to develop nuclear weapons.

“This will make America safer. The Iranian regime is the leading state sponsors of terror,” Trump said, accusing the mad Mullahs of supporting terrorists throughout the volatile region.

The president in his brief remarks from the White House spelled out what he called the agreement’s flaws.

“The deal’s inspection provisions lack adequate mechanisms to prevent, detect, and punish cheating and don’t even have the unqualified right to inspect many locations, including military facilities,” he said.

“Not only does the deal fail to halt Iran’s nuclear ambitions, but it also fails to address the regime’s development of ballistic missiles that could deliver nuclear warheads,” he continued.

“Finally, the deal does nothing to constrain Iran’s destabilizing activities, including its support for terrorism. Since the agreement, Iran’s bloody ambitions have grown only more brazen,” the president said, referring to Iran’s siding with Syrian strongman Bashar al-Assad in that country’s civil war.

“The Iran deal is defective at its core. If we do nothing, we’ll know exactly what will happen. Therefore, I am announcing today that the United States will withdraw from the Iran nuclear deal,” he declared.

The president also issued a not-so-veiled threat at Iran’s leaders.

“If the regime continues its nuclear aspirations, it will have bigger problems than it has ever had before,” he warned.

“America will not be held hostage to nuclear blackmail. We will not allow American cities to be threatened with destruction. And we will not allow a regime that chants ‘Death to America!’ to gain access to the most deadly weapons on earth,” he said.

“Today’s action sends a critical message. The United States no longer makes empty threats. When I make promises, I keep them.”

Trump also said he would reimpose tough economic sanctions on the regime in Tehran.

“We will be instituting the highest level of economic sanctions. Any nation that helps Iran in its quest for nuclear weapons could also be strongly sanctioned by the United States,” he vowed.

The administration said later it would reimpose nuclear sanctions immediately but allow grace periods for businesses to wind down activity so they don’t violate the sanctions.

The Treasury Department says there will be “certain 90-day and 180-day wind-down periods” but didn’t specify which sanctions would fall under which timelines.

Treasury said at the end of those periods, the sanctions will be in “full effect.”

And the commander-in-chief again attacked the Obama administration for brokering the agreement.

“In 2015 the previous administration joined with other nations in a deal on Iran’s nuclear program. The theory was supposed to protect the US and its allies from the lunacy of an Iranian nuclear bomb,” the president said, reading from a Teleprompter.

“The fact is this was a horrible, one-sided deal that should never, never have been made.”

Talks to keep the accord intact collapsed over the president’s insistence that sharp limits be kept on Iran’s nuclear fuel production after 2030.

The current agreement — which Trump has called “insane” and “the worst deal ever” — removed those limits.

Trump’s decision means Iran’s government must now decide whether to follow the US and withdraw or try to salvage what’s left of the deal with the other parties.

Secretary of State Mike Pompeo had said in recent weeks that there was no evidence that Iran breached the deal.

“I’ve seen no evidence that they are not in compliance,” Pompeo told the Senate recently.

But on Tuesday, Pompeo issued a statement calling for new negotiations.

“As we exit the Iran deal, we will be working with our allies to find a real, comprehensive, and lasting solution to the Iranian threat. We have a shared interest with our allies in Europe and around the world to prevent Iran from ever developing a nuclear weapon,” he said.

The move will likely cause the US relations with its European allies, which have committed to sticking with the accord, to plunge further into uncertainty.

Trump’s decision — which also raises the likelihood of heightened tensions with Russia and China — fulfills one of his major campaign promises.

The move risked increasing tensions in a region with several ongoing wars, including the multi-layered conflict in Syria, where Iran’s presence has brought it into conflict with Israel.

France, Britain and Germany — also parties to the accord — were disappointed by the decision.

“France, Germany, and the UK regret the US decision to leave” the Iran nuclear deal, as “the nuclear non-proliferation regime is at stake,” French President Emmanuel Macron said.

Iran’s president on Tuesday warned the country could face “some problems,” just hours before Trump’s announcement — but would eventually recover.

Without directly naming Trump, Hassan Rouhani’s remarks at a petroleum conference in Tehran represented the first official Iranian comment on the president’s overnight tweet that he’d make an announcement Tuesday.

“It is possible that we will face some problems for two or three months, but we will pass through this,” Rouhani said.

Rouhani also stressed Iran wants to keep “working with the world and constructive engagement with the world.”

That appeared to be a nod to Europe, which has struck a series of business deals with Iran since the landmark 2015 nuclear deal.

Iran likely hopes the European Union will pass laws to protect European firms from any potential US sanctions.

European leaders repeatedly tried to persuade Trump to keep the existing deal and negotiate changes.

With Post Wires