While the announcement was broadly welcomed internationally, much work remained to prevent a return to fighting, with UN chief Antonio Guterres calling for all parties to "pave the way towards a lasting and comprehensive peace".
Both Tehran and Washington claimed to have won the more than month-long war, with Trump telling AFP the deal was a "total and complete victory" for the US, although Trump failed to accomplish any of his war's initial goals.
Iran also hailed the ceasefire as a win but warned it would enter talks with the US on Friday in Pakistan with "complete distrust".
"The enemy has suffered an undeniable, historic and crushing defeat in its cowardly, illegal and criminal war against the Iranian nation," said a statement from the Iranian Supreme National Security Council.
"Iran achieved a great victory."
Celebrations erupted across Tehran as residents marked the ceasefire with flag-waving and slogans, some directed against the US and Israel. While many hailed it as a victory.
The White House said Israel had also agreed to the ceasefire, but Prime Minister Benjamin Netanyahu claimed it does not include Lebanon, where Israel's attacks has killed more than 1,500 people.
'Safe opening'
The United States and Israel began the war against Iran on 28 February, following weeks of military buildup and killing over 3,000 Iranians.
Trump said he had spoken to Pakistan's leaders who "requested that I hold off the destructive force being sent tonight to Iran."
He later told AFP he believed China had helped get Tehran to negotiate.
"Subject to the Islamic Republic of Iran agreeing to the COMPLETE, IMMEDIATE, and SAFE OPENING of the Strait of Hormuz, I agree to suspend the bombing and attack of Iran for a period of two weeks," Trump wrote on his Truth Social platform on Tuesday.
Trump had set a deadline for Iran to open the Strait of Hormuz by midnight GMT.
Iranian Foreign Minister Abbas Araghchi confirmed safe passage for two weeks for ships through the strait, which Tehran sealed off in retaliation for the war.
"If attacks against Iran are halted, our Powerful Armed Forces will cease their defensive operations," Araghchi said.
Later on Wednesday, Trump posted on social media that the US would "be helping with the traffic buildup in the Strait of Hormuz".
Uranium to be 'taken care of'
Oil prices plunged by more than 17 percent after the ceasefire announcement, while European natural gas dropped 20 percent. Stock prices also soared in early trade Wednesday in Asia.
Trump said the United States was "very far along" in negotiating a long-term agreement with Iran, which had submitted a 10-point plan that he said was "workable."
But Iran publicly released points, including lifting long-standing US sanctions, guaranteeing its own "dominion" over the strait and removing US forces from the region.
Crucially, it also said its plan would require Washington to accept its uranium enrichment programme.
The ceasefire "does not mean the end of the war" and Iran would only accept a lasting truce if its terms were met, said the Iranian National Security Council in a statement carried on state media.
The temporary ceasefire buys Trump more time to find an off-ramp in a war that polls show is highly unpopular with the American public.
Trump has alleged that Iran was near to building an atomic bomb, an assertion not backed by the UN nuclear watchdog and most observers.
He insisted the nuclear material would be covered by any peace deal.
"That will be perfectly taken care of, or I wouldn't have settled," Trump told AFP, without giving any specifics about what would happen to the uranium.
Trump would not say whether he would go back to his original threats to lay waste to all power plants and bridges across the country of 90 million people if the deal fell apart.
"You're going to have to see," he told AFP.
The US leader had made threats shocking even by his own standards when he warned that "a whole civilization will die tonight, never to be brought back again. I don't want that to happen, but it probably will," calling Iranians "animals."
Trump's rhetoric unnerved world leaders including from members of Congress, the head of the United Nations and Pope Leo.
The ceasefire was cautiously welcomed by Gulf nations, which have been pummelled by Iranian retaliatory strikes for more than a month, while Pope Leo was among world leaders who urged the warring sides to broker a lasting truce.
Underlining the precarity of the deal, there were explosions on Wednesday morning in Bahrain's Manama, with authorities blaming "Iranian aggression".
On Wednesday, the United Arab Emirates, which bore the brunt of Iran's Gulf attacks, also claimed victory.
"The UAE emerged victorious from a war we sincerely sought to avoid," presidential adviser Anwar Gargash said in a post on X.
Saudi Arabia called for a "sustainable" reduction in hostilities while Qatar welcomed "an initial step toward de-escalation".
Egypt -- which in recent weeks has helped shuttle messages between the US and Iran -- praised efforts to "give diplomacy a chance".
Much global reaction, however, focused on the need to turn the ceasefire into a workable peace deal.
Oman, which mediated unsuccessful talks between Washington and Tehran that were halted by the war, spoke of "the importance of intensifying efforts... to identify solutions capable of resolving the crisis at its roots".
British Prime Minister Keir Starmer announced an immediate visit to the Gulf and declared "we must do all we can to support and sustain this ceasefire, turn it into a lasting agreement and re-open the Strait of Hormuz".
* This story was edited by Ahram Online.
Short link: