Iran's President Hassan Rouhani says Tehran will not be the first country to violate a 2015 nuclear deal, hitting back at US President Donald Trump who has hinted he might pull out of the pact.

Addressing the UN General Assembly (UNGA) on Wednesday, Rouhani said his country would respond "decisively and resolutely" if the agreement - signed between Iran and world powers under which Tehran agreed to curb its nuclear programme in return for relief from economic sanctions - is violated by any party.

"By violating its international commitments the new US administration only destroys its own credibility," he said, reiterating Iran's assurance that Tehran is not planning to develop nuclear weapons.

READ MORE: Trump threatens to 'destroy North Korea' if necessary

He also criticised Trump for the speech he made at the UNGA on Tuesday, in which the US president claimed Iran was exporting violence and destabilising the Middle East and bashed the nuclear deal as an "embarrassment" to the US.

Rouhani called Trump's remarks an "ignorant, absurd and hateful rhetoric filled with ridiculously baseless allegations".

"It will be a great pity if this agreement were to be destroyed by rogue newcomers to the world of politics: the world will have lost a great opportunity," Rouhani said, adding that Iran was a moderate country dedicated to maintaining peace.

Al Jazeera's James Bays, reporting from the UN headquarters in New York, described Rouhani's address as "a carefully crafted speech".

"Clearly, what the Iranians try to do is make their president look like the good guy," Bays said, adding that the word "moderation" was repeated throughout Rouhani's speech.

"At the same time, he also attacked the tone of Trump's speech," Bays added.

"It is interesting that he mentioned that the Iran deal was endorsed in a Security Council resolution, so if Trump pulls out, he in effect could be in violation of a Security Council resolution, in effect of international law.

"So I think the Iranians are already thinking one step ahead as I think they are beginning to feel that it's likely that Trump will pull out.

US Secretary of State Rex Tillerson said that "sunset clauses" that allow Tehran to resume its nuclear programme after a certain period of time were a primary shortcoming of the agreement.

"One can almost set the countdown clock to Iran resuming its nuclear activities," he said.

He went on to say that in the broader context, "the aspirations" of the deal had not been met, although reports from the UN nuclear watchdog, the International Atomic Energy Agency (IAEA), "continue to confirm that Iran is in technical compliance with the agreement".

Decision made

Trump said on Wednesday that he had made his decision on whether his country will remain in the nuclear pact, but declined to reveal it.

"I have decided," Trump told reporters when asked if he had made up his mind.

Mark Farha, assistant professor at Doha Institute, told Al Jazeera Trump was ambiguous on purpose.

"This is the way Trump operates in all diplomatic matters. He likes ambiguity; he thinks that's a strength," he said.

"He likes brinkmanship, keeping people on their toes, not knowing which move he will make next, it's part of his strategy.

"It's a dangerous strategy, especially in cases like North Korea and Iran where you have a lot of other contingencies at play."

READ MORE: UN nuclear watchdog defends Iran agreement

The prospect of Washington reneging on the agreement has worried some US partners that helped negotiate it.

French President Emmanuel Macron said it would be a mistake to pull out of the pact.

"According to me, we have to keep the 2015 agreement because it was a good one," Macron told reporters at the UN.

Russia is concerned by Trump questioning the Iran nuclear deal, Foreign Minister Sergey Lavrov told Russian reporters at the UN in comments published by his ministry on Wednesday.

"It's extremely worrying," Lavrov said. "We will defend this document, this consensus, which was met with relief by the entire international community and genuinely strengthened both regional and international security."

Lavrov, referring to Trump's speech, said that "if you simply condemn and threaten, then we're going to antagonise countries over whom we want to exert influence".