In response, US Central Command said on Friday it had struck missile and drone storage facilities and coastal radar positions. There has been no comment yet from Iran.BBC reported.
Just moments before the strikes were announced, Trump said "you'll see" when asked if the US would respond to the Iranian attack.
US Central Command or Centcom described the strikes as "a powerful response" to the drone attack.
"The unwarranted aggression against commercial shipping by Iranian forces clearly violated the ceasefire," it said in a statement.
"Furthermore, Iran's dangerous behavior undermined freedom of navigation as commerce increasingly flows through the vital international trade corridor."
Centcom said the US military would "continue to provide safe passage coordination and support to commercial vessels transiting the strait".
For the moment, it is unclear if the US attacks were isolated or form part of a larger, ongoing response.
After US and Israeli attacks against Iran began at the end of February, Tehran effectively closed the strait - a critical waterway for oil and gas shipments - causing a spike in global oil prices and choking off shipments of other crucial commodities such as fertiliser.
The US and Iran agreed on 17 June to end hostilities under a 14-point memorandum of understanding, which had also called for Iran to use its "best efforts for the safe passage of commercial vessels with no charge for 60 days".