The attacks followed a new Trump-led maritime initiative aimed at restoring commercial traffic through the Strait of Hormuz after months of disruptions.