US Secretary of State Rex Tillerson held his first meeting with Iranian Foreign Minister Mohammad Javad Zarif later, alongside the other parties to the accord.
France, Germany and Britain have not signed on to the criticism lodged by the new US Administration, and French President Emmanuel Macron used his meeting here with Trump on Tuesday to urge the US leader to stick with it. The agreement meant an infusion of cash and investment in Iran, much of it from European businesses liberated from international economic sanctions on Iran.
It has been an open question whether the agreement could survive without the United States, whose participation was the key to Iranian willingness to strike a bargain, limiting what it asserts is a peaceful nuclear programme.
Rouhani's remarks are a declaration that the deal cannot be renegotiated to address US concerns and cannot be reconstituted without the United States.
Rouhani also suggested that if the United States abrogates the terms of the deal, Iran could resume larger-scale uranium-enrichment activities - a move likely to rekindle international fears that Tehran would be able to accelerate the development of nuclear weapons.
"If anyone exits the agreement and breaks their commitment, it means our hand is completely open to take any action that we see as beneficial to our country," Rouhani said at a news conference after his address to the UN General Assembly.
"The JCPOA has no other conditions," Rouhani said. "It is the JCPOA in its current form."
Tillerson later told reporters he was not discouraged by Rouhani's refusal to consider any kind of modification of the deal.
"As a longtime negotiator, I learned to never say never," he said. "And second, it always gets the darkest before you might have a breakthrough. As I've said to people many times, as the nation's chief diplomat, I better be the most optimistic person standing in the room."
Tillerson said the meeting between diplomats whose countries signed the nuclear deal was civil and matter of fact, even though he and Zarif clearly differed in their assessment of the agreement.
"There was no yelling," he said. "We did not throw shoes at each other."
Trump said that he has decided what to do about the Iran deal, which he has strongly and repeatedly criticised, but he did not say what that decision was.
Speaking in New York after a meeting with Palestinian Authority President Mahmoud Abbas, Trump responded to a reporter's question about whether a decision has been made about the future of the accord.
"I have decided," Trump said, three times.
Pressed by reporters to reveal his decision, Trump smiled and said, "I'll let you know what the decision is."
Under US law, Trump must decide by October 15 whether to recertify Iran's compliance with the agreement. The International Atomic Energy Agency, which has inspectors in Iran to monitor its nuclear facilities, has said eight times that it is complying.
If Trump does not recertify it, Congress will have 60 days to decide whether to reimpose US sanctions that were lifted when the deal took effect. That would in effect be a withdrawal.
Trump, in his speech to the General Assembly, called the agreement with Iran an embarrassment and "one of the worst and most one-sided transactions the United States has ever entered into".
In that fiery speech, he also said that Iran is a "murderous regime" that he put in the same category with rogue nations such as North Korea.
That led Rouhani to demand an apology.
"Mr Trump was offensive to Iran, and we are waiting for Mr Trump to apologise to the people of Iran," Rouhani said through an interpreter.
Rouhani, during a 23-minute address at the UN General Assembly, never mentioned Trump by name. Instead he referred to him obliquely, saying it would be a pity if the nuclear deal were undone by "rogue newcomers to the world of politics" and condemning "ignorant, absurd and hateful" remarks.
Rouhani denied that Iran had ever sought to obtain nuclear weapons and said the ballistic missiles it has been testing would be used only for defensive purposes.
Trump and other US officials have criticised the nuclear deal for failing to address Iranian ballistic-missile programmes and Iran's alleged support for terrorism.
The criticism echoes long-standing conservative doubts about the value of the deal if it addressed only the potential threat of nuclear weapons. The Trump Administration and Israel have also complained that even the nuclear protections are weak, since some of them expire in 10 to 15 years.
In his speech, Rouhani took umbrage at Israeli Prime Minister Benjamin Netanyahu's criticism of Iran the day before, when he called Iran the greatest threat to world peace.
"It is reprehensible that the rogue Zionist regime that threatens regional and global security with its nuclear arsenal and is not committed to any international instrument or safeguard has the audacity to preach [to] peaceful nations," he said.
Rouhani said that the time frame and deadlines contained in the deal were all carefully worked out and will not be revisited.
He also said the end of the nuclear deal would be more detrimental to the United States than to Iran.
"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," he said.