His statement came just hours after Iran launched a barrage of missiles that, according to Israel's emergency medical service, killed four people, the Reuters news agency reported.
"The ceasefire is now in effect. Please do not violate it!" Trump said in a post on his Truth Social platform.
"On the assumption that everything works as it should, which it will, I would like to congratulate both countries, Israel and Iran, on having the stamina, courage, and intelligence to end what should be called 'the 12-day war,'" Trump wrote.
Iran's SNN news agency reported that Tehran had fired its final round of missiles shortly before the ceasefire took effect, according to Reuters.
A senior White House official was quoted as saying that Trump brokered the deal during a call with Israeli Prime Minister Benjamin Netanyahu, and Israel agreed to the ceasefire on the condition that Iran would not carry out further attacks.
On Monday, Iran launched a missile strike on the Al Udeid US air base in Qatar in response to American air strikes on Iranian nuclear sites, according to reports.
Iran described Monday's strike as "devastating and powerful," but US officials said no American personnel were killed or injured, according to Reuters.
Trump said Iran had fired 14 missiles at the US air base, calling it "a very weak response, which we expected, and have very effectively countered."
In its handling of the attack, Tehran appeared to strike a balance between delivering a symbolic military response and avoiding a wider escalation it could not sustain, Reuters reported.
The Iranian strike followed US bombing raids over the weekend, in which American forces dropped bunker-buster bombs on underground Iranian nuclear facilities, joining Israel's air war, according to reports.
Earlier this month, Israel launched a wave of air strikes on Iran, targeting nuclear facilities, ballistic missile production sites and senior military commanders in what it called the start of a sustained operation aimed at preventing Tehran from developing a nuclear weapon.
(gs)
Source: Reuters, IAR, PAP