As the USS Harry S. Truman was transiting the strait, which connects the Arabian Sea and the Persian Gulf, the Iranian Revolutionary Guards were conducting a live-fire exercise, officials told NBC News.
The Truman reportedly was being escorted through the strait by a US destroyer and a French frigate. Other commercial traffic was in the area as well.
Officials told NBC News that the US ships were in the "internationally recognized maritime traffic lane" when the Iranian Navy announced over maritime radio that it was about to conduct a live-fire exercise and asked other vessels to remain clear. At no time did the Truman stray into Iranian territorial waters, the official added.
Following the warning, rockets were fired from a position of about 1,500 yards off the carrier's starboard side and in a direction away from the passing coalition and commercial ships and the traffic lane, the official said. The rockets were not fired at the Truman and other ships.
While the official said the Iranians were "clearly not" targeting ships, the action was "unnecessarily provocative and unsafe." There were no direct communications between US and Iranian navies.
The Truman recently returned to the region to support coalition-led airstrikes against Daesh.