Iran's President Hassan Rouhani has labelled Donald Trump a “rogue newcomer” in international politics, attacking the US leader's “ignorant and absurd” rhetoric for suggesting the nuclear deal with Tehran could be ripped up.

During his address to the United Nations General Assembly, Mr Rouhani said that if the US decides to scrap the deal negotiated by the Obama administration, the nation would only demolish its own credibility.

“It will be a great pity if this agreement were to be destroyed by rogue newcomers to the world of politics,” Mr Rouhani said. “By violating its international commitments, the new US administration only destroys its own credibility and undermines international confidence in negotiating with it or accepting its word or promise.”

Mr Trump had used part of his own speech to the assembly on Tuesday to condemn Iran as “a corrupt dictatorship behind the false guise of a democracy”, saying that the country’s oil profits go toward funding terrorist groups, Yemen’s civil war and Bashar al-Assad’s government in Syria.

“We cannot let a murderous regime continue these destabilising activities while building dangerous missiles, and we cannot abide by an agreement if it provides cover for the eventual construction of a nuclear programme,” Mr Trump said. “The Iran Deal was one of the worst and most one-sided transactions the United States has ever entered into.”

For his part, Mr Rouhani said Iran desired to preserve its accord with six world powers – including the US, UK and France – under which Tehran agreed to restrict its nuclear program for at least a decade in return for the loosening of economic sanctions that crippled its economy.

“The Islamic Republic of Iran will not be the first country to violate the agreement,” Mr Rouhani said, adding that Iran would respond “decisively and resolutely” to a violation by any party.

After Mr Rouhani's speech, Mr Trump told reporters that he had decided about whether to rip up the agreement, but refused to say what that decision was.

Mr Trump’s criticism of the deal has put him at odds with other world leaders, including the UK's Prime Minister Theresa May, who has called the agreement “vital”, and France’s President Emmanuel Macron. Mr Macon on Tuesday said the nuclear deal was “essential for peace”.

Mr Trump on Wednesday told reporters he has decided on whether to scrap the deal, but would not disclose his decision.

Donald Trump's international Presidential trips Show all 22 1 /22 Donald Trump's international Presidential trips Donald Trump's international Presidential trips French President Emmanuel Macron and US President Donald Trump AFP/Getty Images Donald Trump's international Presidential trips French President Emmanuel Macron and US President Donald Trump talk as they leave the Army Museum at Les Invalides in Paris AFP/Getty Images Donald Trump's international Presidential trips German Chancellor Angela Merkel and US President Donald Trump arrive for the group photo at the G7 Taormina summit on the island of Sicily in May 2017 Getty Images Donald Trump's international Presidential trips Mr Trump was pressed on the subject at the G7 summit in Italy Getty Donald Trump's international Presidential trips US President Donald Trump gives a speeech at the Warsaw Uprising Monument on Krasinski Square Getty Donald Trump's international Presidential trips US President Donald Trump and Britain's Prime Minister Theresa May during a ceremony at the NATO headquarters before the start of a summit in Brussels, Belgium Reuters Donald Trump's international Presidential trips Montenegro's Prime Minister Dusko Markovic is seen to the right of Donald Trump at a Nato summit in Brussels REUTERS Donald Trump's international Presidential trips Pope Francis meeting with US President Donald J. Trump EPA Donald Trump's international Presidential trips Pope Francis poses with US President Donald Trump and First Lady Melania Trump AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump arrives at Palazzo del Quirinale ahead of the meeting with Italian President Sergio Mattarella Ufficio Stampa Presidenza della via Getty Donald Trump's international Presidential trips US President Donald Trump is seen during a joint press conference with the Palestinian leader at the presidential palace in the West Bank city of Bethlehem AFP/Getty Images Donald Trump's international Presidential trips Palestinian president Mahmoud Abbas meets US President Donald Trump PPO via Getty Donald Trump's international Presidential trips Israeli Prime Minister Benjamin Netanyahu speaks with US President Donald Trump prior to the President's departure GPO via Getty Images Donald Trump's international Presidential trips US President Donald Trump and Israel's Prime Minister Benjamin Netanyahu shake hands after delivering a speech at the Israel Museum AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump and First Lady Melania Trump lay a wreath in the Hall of Remembrance as White House senior advisor Jared Kushner and Ivanka Trump watch on during a visit to the Yad Vashem Holocaust Memorial museum AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump visit to Yad Vashem Holocaust museum in Jerusalem accompanied by Prime Minister Benjamin Netanyahu GPO via Getty Images Donald Trump's international Presidential trips US President Donald Trump takes his seat before his speech to the Arab Islamic American Summit in Riyadh in Saudi Arabia Reuters Donald Trump's international Presidential trips Saudi Arabia's King Salman bin Abdulaziz al-Saud, US President Donald Trump and US First Lady Melania Trump look at a display of Saudi modern art at the Saudi Royal Court in Riyadh AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump and Saudi Arabia's King Salman bin Abdulaziz al-Saud take part in a signing ceremony at the Saudi Royal Court in Riyadh AFP/Getty Images Donald Trump's international Presidential trips King Salman presents Donald Trump with The Collar of Abdulaziz al-Saud Medal at the Royal Court Palace on 20 May AP Donald Trump's international Presidential trips US President Donald Trump is welcomed by Saudi King Salman bin Abdulaziz al-Saud upon arrival at King Khalid International Airport in Riyadh AFP/Getty Images Donald Trump's international Presidential trips U.S. President Donald Trump and first lady Melania Trump walk on the South Lawn prior to their first foreign trip Getty Images

The US’s ambassador to the UN, Nikki Haley, had earlier said that while the President’s rhetoric in his speech was not a “clear signal he plans to withdraw” from the accord, it demonstrated he’s “clearly not happy” with it.

“The United States is not safer because of it, I think if you look at, yes, on one side it deals with the nuclear development, the JCPOA (Joint Comprehensive Plan of Action) which everyone talks about, but US law requires it to look at other things which Iran is in violation of,” Ms Haley said, pointing to claims of Iran smuggling arms and continuing to test ballistic missiles in the region.

Mr Rouhani said in the wake of his speech that he did not think Washington would leave the nuclear deal and said any country that abandoned the pact would isolate and embarrass itself.

“We don't think Trump will walk out of the deal despite (his) rhetoric and propaganda,” Mr Rouhani said.

“If American officials think that they can pressure Iran by walking out of the deal, they are making a big mistake,” he added. “Either the nuclear deal remains as it is or it will collapse.”

Over the weekend, US Secretary of State Rex Tillerson said that while Iran was technically complying with its commitments in the agreement, it was also supporting terrorist organisations and backing militias in Yemen and Syria.

Mr Rouhani was not the only one to hit back at Mr Trump's rhetoric in his UN speech. The head of Iran's Revolutionary Guards said the US should experience “painful responses” for Mr Trump's words.

“Taking a definitive stand against Trump is only the beginning of the path,” said General Mohammad Ali Jafari, according to Sepah News, the news site of the Revolutionary Guards.

“What is strategically important is that America witnesses more painful responses in the actions, behaviour and decisions that Iran takes in the coming months,” Mr Jafari said.

Over the summer, tensions between the Iran and US intensified in the Persian Gulf, with both sides accusing each other of provocative manoeuvres with military vessels.

Mr Trump also recently signed into law a new package of sanctions on the Middle Eastern country, which deputy foreign minister and senior Iranian negotiator Abbas Araghchi has called a “hostile” breach of the Iran deal.