Iran’s President Hassan Rouhani says the United States would regret leaving the 2015 nuclear agreement and that his country has prepared plans to respond to any decision by U.S. President Donald Trump regarding the landmark accord.

"We have plans to resist any decision by Trump on the nuclear accord," Rouhani said in a May 6 speech in northwestern Iran that was carried live by state television.

"If America leaves the nuclear accord, you will see soon that this will entail historic remorse for it,” he added.

Rouhani did not specify how Iran would react if the United States abandons the deal. But he said he had given "the necessary orders," notably to Iran's Atomic Energy Organization, in anticipation of Trump's decision.

Trump has threatened to pull the United States out of the Iran nuclear deal unless European allies fix its “terrible flaws” by May 12.

The deal provides Tehran with relief from sanctions in return for significant curbs on its nuclear program, but Trump has said the terms are not strict enough.

Germany, France, Russia, China, and Britain have also signed the accord and have urged Washington to remain part of the deal, saying it is the best way to prevent Iran from acquiring nuclear weapons.

Iranian officials have said that Tehran rejects demands by Trump for changes in the nuclear deal.

"Iran will not renegotiate what was agreed years ago and has been implemented," Iran’s Foreign Minister Mohammad Javad Zarif said in video posted on YouTube on May 3.

Speaking on May 5, Ali Shamkhani, secretary of Iran’s Supreme National Security Council, said his country will stand up to Trump’s “bullying” over the nuclear deal.

“This is an international agreement...and we certainly have the capacity to defeat your bullying,” Shamkhani said in remarks aired on the state-controlled television.

UN Secretary-General Antonio Guterres warned last week against ditching the nuclear deal if it could not be replaced with a viable alternative.

"If one day there is a better agreement to replace it, it's fine. But we should not scrap it unless we have a good alternative," Guterres said in a May 3 interview.