Trump added that a plan was in place for US forces to carry out "the biggest attack since World War II" on Sunday.
But he decided to scrap the plan and give diplomacy more time to play out after hearing from key Gulf leaders - including Saudi Crown Prince Mohammed bin Salman - as well as at the request of unnamed Iranian officials.
"I said to the crown prince, 'What would you rather do? Would you rather us do this or not?'" Trump told reporters on Air Force One as he flew back to Washington after spending the weekend at his golf club in Bedminster, New Jersey.
"They said we would much prefer a deal as opposed to an attack, because you don't know where these attacks lead."
Trump and the crown prince spoke on Saturday before the US president announced in a social media post that Mideast allies had reached the "perimeters" of a deal to end the five-month-old war.
It was another turnabout for Trump, who a day earlier said he's "losing faith" in negotiations with Iran and offered the ominous warning that the US military "will be hitting them very hard".
Trump reiterated any deal would include a reopening of the Strait of Hormuz, the critical waterway where about a fifth of all traded oil and natural gas flowed before the start of the war, and would resolve US concerns about Iran's nuclear program.
Iran has repeatedly attacked vessels attempting to transit through the Strait of Hormuz without its authorisation as part of its conflict with the US
And Iran's Foreign Ministry spokesperson Esmail Baghaei said on Sunday that the Strait of Hormuz "will in no way return to the status it was before February 28th".
On a call with Iranian state TV, he added that Iran is discussing shipping through the strait with Oman, on the other side of Hormuz, but that there's no talk about reopening the crucial waterway.
Trump has announced halts to strikes on Iran on several occasions since the US and Israel attacked Iran, only for things to unravel and fighting to resume again.
Iran's defence minister said the country was "neither surprised nor passive" following Trump's announcement and said the Islamic Republic remained alert in the face of concrete threats from the US
While Iran's leaders appear united in a war strategy signalling strength and endurance, a struggle for control seems to be brewing within the theocracy's leadership between those who oppose all negotiations with the US and others who count on military pressure to win at the negotiating table.
Trump on Sunday said he expected negotiations to resume "tomorrow afternoon" but did not detail who would be involved in such talks.
Prince Mohammed, the Saudi de facto leader, raised concerns about the US potentially escalating the conflict when he spoke with Trump by phone on Saturday.
The call was "candid and constructive", according to a person briefed on the call who was not authorised to comment publicly.
The crown prince conveyed that an escalation in fighting could have a severe impact on the global economy if Tehran responded to a new US bombardment by targeting some of the United States' Gulf allies.
The call happened before Trump's social media announcement, the person said. The crown prince sought clarity from Trump on what potential new action he was weighing to take against Iran.
Trump suggested that his conversation with the Saudi crown prince weighed heavily in his decision to halt his plans to carry out strikes on Iran.
"It would have been disastrous for them. And they didn't want us to do it," Trump said.
"And frankly, Saudi Arabia didn't want it either. They thought that a deal is imminent."
with Reuters and AP