President Hassan Rouhani of Iran said Tuesday that if President Donald Trump backs out of the 2015 nuclear deal, "no one will trust America again" and his country could then resume work on expanding its nuclear capabilities.

Rouhani raised that possibility in an interview with NBC News just before Trump spoke for the first time as president before the United Nations General Assembly, where he called Tehran a "murderous regime" and the nuclear deal "an embarrassment to the United States."

Under the framework agreement between Iran and six world powers — the U.S., the U.K., France, China, Germany and Russia — Tehran agreed to curb its nuclear program in exchange for the lifting of some economic sanctions.

Trump and his top diplomats have threatened to withdraw from the deal, known as the Joint Comprehensive Plan of Action, saying Iran has violated it in spirit, if not in letter.

"The exiting of the United States from such an agreement would carry a high cost, meaning that subsequent to such an action by the United States of America, no one will trust America again," Rouhani told Nightly News anchor Lester Holt in a one-on-one interview airing Tuesday.

He added: "Every word was analyzed many times by countries involved before its ratification, so if the United States were to not adhere to the commitments and trample upon this agreement, this will mean that it will carry with it the lack of subsequent trust from countries towards the United States because the greatest capital that any country has is trust and credibility."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Lester Holt interviews Iranian President Hassan Rouhani at the United Nations on Sept. 19. NBC News

The Trump administration recently imposed new economic sanctions on Iran, citing its development of ballistic missiles and the launching of a satellite-carrying rocket into space. And while Trump has reluctantly certified to Congress that Tehran is in compliance with the agreement ─ a stance that six fellow signatories share ─ he may take a more aggressive approach when the deal comes up for renewal in October.

Trump is also reportedly weighing new measures against Iran's proxy forces in Iraq and Syria, and its support for militant groups elsewhere.

Related: Iran Pledges To Press On With Missile Program, Slams Sanctions

Asked if Iran would continue to abide by the deal if the United State withdrew, Rouhani said his country's commitments "would no longer exist" and it would be free to pursue a new path.

"One of the options and choices were one of our counterparts not to remain in the current framework would be to go back to previous activities," Rouhani said. "This is one option. And that's not difficult. We can easily go back to previous conditions if counterparts were to not live up to their commitments. But you do know fairly well that Iran will not be the initiator of this return to that path."

But he stressed that Iran would resume "peace activities only," saying the country had no intention of leaving the agreement.

"So we will never go towards production of nuclear weapons, just as in the past we never intended to go towards that path nor did we ever. It has always been peaceful."

Rouhani defended Iran's use of ballistic missiles, saying that it fell outside the nuclear agreement and that his country would never sacrifice its "defensive missile capabilities."

He also complained that the Trump administration was lumping Iran in with North Korea by describing both countries as nuclear threats.

Related: Iran Nuclear Deal: Trump Drive to Ax Pact May Alienate Allies

"We wish to have nuclear energy for peaceful uses just as today, in Arak, there is collaboration between America, China and Iran for the completion of the power plant in Arak," Rouhani said of the industrial city where his country has been modifying a reactor pursuant to the nuclear agreement.

Rouhani also addressed Iran's detention of a father and son, Baquer and Siamak Namazi, who have joint American and Iranian citizenship and were convicted of "collaborating with an enemy state."

The Iranian president said Tehran does not recognize dual citizenship, and so the courts see the Namazis as Iranians only. And he said the government's separation of powers prevented him from influencing a decision by the judiciary.