But both sides drew back from the brink, while Arab and other international leaders called for restraint. In Iraq, Muslim Shi'ite groups, opposed to the U.S. presence in Iraq, also sought to cool passions.
"The fact that we have this great military and equipment, however, does not mean we have to use it. We do not want to use it," Trump told the nation after saying Iranian ballistic missiles fired in the early hours of Wednesday caused no casualties and limited damage.
He said Iran "appears to be standing down, which is a good thing for all parties concerned" but he said the United States would impose additional sanctions on Iran, adding to measures that have slashed its oil exports and crippled its economy.
Trump, who faces re-election this year and who accused predecessors of dragging the United States into unnecessary regional wars, did not say what new sanctions would involve.
His comments came hours after Iran's foreign minister said Iranian missile strikes "concluded" its response to the killing of Qassem Soleimani, a powerful general who masterminded Iran's drive to build up proxy armies abroad.
The minister, Javad Zarif, said on Twitter that Iran did not "seek escalation or war, but will defend ourselves against any aggression".
Supreme Leader Ali Khamenei had called Iran's missile attack a "slap on the face" for the United States and said Iran remained determined to drive U.S. forces out of the region, a policy that analysts say it has pursued via its proxy forces.
But Washington said it had indications Tehran was telling its allies to refrain from new action against U.S. troops.
CALLS FOR PATIENCE
U.S. Vice President Mike Pence told CBS News the United States was receiving "encouraging intelligence that Iran is sending messages" to its allied militias not to attack U.S. targets.
Moqtada al-Sadr, an influential Shi'ite cleric opposed to U.S. and Iranian interference in Iraq, said the Iraq crisis was over and called on "Iraqi factions to be deliberate, patient, and not to start military actions".
Kataib Hezbollah, an Iran-backed militia the United States blamed for an attack in Iraq in December that killed a U.S. contractor, said "amidst these conditions, passions must be avoided to achieve the desired results" of expelling U.S. forces.
That contrasted with fiery comments early on Wednesday from Qais al-Khazali, leader of another Iran-backed militia, who said Iraqi forces should respond to the killing of Abu Mahdi al-Muhandis, who died with Soleimani in the Jan. 3 U.S. strike.
Arab states, which lie across the Gulf from Iran and feared their region was being dragged into another conflict, also called for cooler heads to prevail in Iraq and beyond.
"The brotherly Arab nation of Iraq today is in need of solidarity among its people to avoid war and becoming the site of a battle in which it would lose most," Saudi Arabia's Foreign Minister Prince Faisal bin Farhan wrote on Twitter.
In Trump's address on Wednesday, he repeated his promise not to allow Iran to obtain a nuclear weapon - an ambition it denies ever having - and called for world powers to quit the 2015 nuclear accord with Iran that he abandoned.
Trump said world powers should negotiate a new nuclear deal with Iran to replace the one set in place under Barack Obama.
Iran has rejected new talks and said negotiations could not be held without an end to sanctions, which have sent Iran's currency plunging and slashed vital oil revenues.
There has been no immediate reaction from Iranian officials to Trump's address. The semi-official Fars news agency described the U.S. president's remarks as a "big retreat from threats".
Analysts have said Iran, despite its strident words, has wanted to avoid a conventional war with superior U.S. forces.
U.S. and European government sources said they believed Iran had deliberately sought to avoid U.S. military casualties in its missile strikes to prevent an escalation.
An Iranian army spokesman denied "foreign media reports" suggesting there was some kind of coordination between Iran and the United States before the attack to evacuate bases.
(Reporting by Ahmed Aboulenein and Ahmed Rasheed in Baghdad, Babak Dehghanpisheh, Parisa Hafezi and Ghaida Ghantous in Dubai, Jeff Mason in Washington Writing by Edmund Blair Editing by Robert Birsel) ((email@example.com; Reuters Messaging: firstname.lastname@example.org))