US military launched attacks on Iran following a strike on a ship in the Hormuz region, triggering alerts in Gulf states.