Iran launched missiles overnight at two US air bases in Jordan in response to a US attack on Iran's Larak Island, where Washington said it had struck Iranian launchers firing mines into the Strait of Hormuz.
The exchange highlighted how quickly a conflict that has increasingly been fought through sanctions, blockades and economic pressure can still spill back into military action.
While neither side appeared to be seeking a return to full-scale war, both signalled they were prepared to respond to further attacks.
"We're going to hit them hard," a Fox News reporter quoted Trump as later telling the channel.
"There will be a response."
Trump told reporters in the Oval Office the renewed strikes did not signal a return to full-scale war, describing Iran as a "failed nation" whose economy and military had been severely degraded.
"That doesn't mean we won't smack them. We'll see what happens."
Asked whether he had ruled out using nuclear weapons against Iran, Trump said there was "no reason" to do so because Iran was already "totally defeated militarily".
A senior Iranian source told Reuters the overnight exchanges of fire were a "limited and contained confrontation" but said Tehran would deliver a harsh response if attacked again.
Trump said US air defences had downed all Iranian missiles that could have caused any damage and new US economic sanctions on Iran were having a big impact, Fox News reported.
Earlier, Trump had posted to social media two videos depicting explosions engulfing Iran's main oil export terminal, with the message "Kharg island being blown to smithereens!!!"
But the videos were generated by AI and no such attack took place.
Iran called Trump's post "laughable".
Vice President JD Vance told reporters Trump "likes to switch it up on social media a little bit" and was "sending a message".
Washington has so far mainly held off from hitting Iran's major oil and gas infrastructure, a move that Iran says would be met with devastating attacks against its Gulf neighbours.
Washington has, instead, stepped up efforts to punish Tehran and its business partners with "secondary sanctions" that hit third countries buying its oil.
US Treasury Secretary Scott Bessent said that Iran was "lashing out" now because the new sanctions were taking a toll on its economy.
"They're in shock at the state of their economy," Bessent told reporters at a meeting of G20 finance ministers and central bank governors in North Carolina.
"I would think that they are lashing out kinetically because they are losing economically."
US forces struck two Iranian launchers on Iran's Larak Island on Sunday, an official said, after "Islamic Revolutionary Guard Corps forces were observed preparing to launch rockets with sea mines into the Strait of Hormuz".
Three people were killed in the attack, Iran's Tasnim news agency reported.
Larak is a small island in the strait near the strategic Iranian port of Bandar Abbas. The Strait of Hormuz, which normally handles 20 per cent of global crude oil and gas shipments, has been effectively blocked since the start of the war.
US Central Command said it had taken "limited, precise" action against mine laying forces of Iran's Revolutionary Guards that posed an "imminent threat" in the strait.
A tanker was struck by three projectiles while sailing out of the Strait of Hormuz, 17 nautical miles east of Oman's Khasab, the United Kingdom Maritime Trade Operations agency said on Tuesday.
No casualties or environmental impact were reported, UKMTO said.
Iranian President Masoud Pezeshkian nevertheless said on Monday Tehran still favoured a negotiated settlement.
"We believe that continuing the war is in no one's interest, neither ours, nor the region's, nor humanity's," Iran's semi-official Tasnim news agency quoted him as saying.