"Iran was about one month, maybe two months, away from having a nuclear weapon. And if I allowed that to happen, this deal would not have been possible," Trump told Fox News in a phone interview on Wednesday evening.
"It's a very much different Iran. And frankly, we've had some very good conversations. And as you saw, they blessed the deal. They put out a few hours ago a statement that they agree with the deal, and they blessed the deal," he added, without elaborating. "That's a tremendous thing."
Tehran had not published any official reaction to the announcement by the United States, Hamas and Israel that the parties had agreed to the release of hostages held in Gaza in exchange for a partial pullback of Israeli forces and the freeing of Palestinian political prisoners.
US planes and submarine-launched missiles attacked three key Iranian nuclear sites on June 22, capping off a surprise Israeli military campaign against the Islamic Republic which battered its arch-foe.
Tehran denies seeking a nuclear weapon, called the attacks illegal and has vowed to resist what it calls Israeli aggression. Still, officials have long said they would support any peace deal agreed by Palestinians.
Iran has backed Palestinian militants and armed affiliates throughout the Middle East it calls a "Resistance Axis" opposed to Israel and the United States.
"I believe if they had a nuclear weapon, there would be a whole different even if we made the deal, it would have, literally, a very dark cloud over it because of what could potentially happen," Trump added.
"And by the way, I believe Iran is going to be actually a part of the whole peace situation," he added.