BEIRUT (Reuters) - Iran’s president said on Thursday its nuclear accord with world powers cannot be renegotiated, after the Trump administration warned it was weighing whether the deal signed by its predecessor served U.S. security interests.

Iranian President Hassan Rouhani addresses the 72nd United Nations General Assembly at U.N. headquarters in New York, U.S., September 20, 2017. REUTERS/Shannon Stapleton

Under the 2015 deal, Iran agreed to limit its disputed nuclear program in return for the easing of economic sanctions. U.S. President Donald Trump called the deal an “embarrassment” during his first speech at the United Nations on Tuesday.

“There was some discussion by some people that the nuclear deal isn’t very bad but shouldn’t stay as it is. (That) it’s a deal that’s good but we should sit down again and debate to see if it can be improved. If it has flaws we can fix them,” Iranian President Hassan Rouhani said.

“They were told clearly and definitively (by us) that the nuclear deal cannot be renegotiated,” he told a press conference in Tehran broadcast live on state television after his return from the U.N. General Assembly.

Trump told reporters this week he had made a decision on what to do about the agreement, approved by his predecessor Barack Obama along with leaders of Russia, China, Britain, France and Germany, but would not say what he had decided.

However, although Trump does not like the deal, his speech to the United Nations on Tuesday did not mean Washington would withdraw from the pact, Nikki Haley, U.S. Ambassador to the U.N., said on Wednesday.

The prospect of Washington reneging on the deal has worried some of the U.S. allies that helped negotiate it, especially as the world grapples with another nuclear crisis, North Korea’s nuclear and ballistic missile development.

If Trump does not certify next month that Iran is complying with the accord, the U.S. Congress will have 60 days to decide whether to reimpose sanctions waived under the deal. U.N. inspectors have verified Iranian compliance with the terms.

In contrast with Obama’s policy of detente with Iran after decades of mutual hostility, Trump called Iran “a corrupt dictatorship” on Tuesday and accused it of supporting terrorism and destabilizing the Middle East.

“(Trump) made big mistakes in this speech,” Rouhani said. “There were baseless and unfounded accusations. It wasn’t worthy of the United Nations or an individual who sees himself as the president of a country.”

Iranian Supreme Leader Ayatollah Ali Khamenei, the highest authority in the Islamic Republic, also criticized Trump during a meeting Thursday with the Assembly of Experts, a body tasked with choosing the next Supreme Leader.

“This speech was not a sign of power but rather a sign of anger, frustration and stupidity,” Khamenei said, according to a report on his official website.

In recent months, tensions have ramped up between Iran and the United States in the Gulf, with both sides accusing each other of provocative naval maneuvers.