The United States has accused Iran of launching rockets near a US aircraft carrier and other warships last week in what a US official called an "unsafe" action. It said Iran gave very short notice before the tests.
Iranian Revolutionary Guard vessels launched the rockets on December 26 in the Strait of Hormuz close to coalition warships involved in supporting airstrikes against the "Islamic State" group in Iraq and Syria, a US military spokesman said early on Wednesday.
"These actions were highly provocative, unsafe and unprofessional and call into question Iran's commitment to the security of a waterway vital to international commerce," said Commander Kyle Raines, a spokesman for the US Central Command.
He said the missile test occurred as the USS Harry S. Truman aircraft carrier, the USS Bulkeley destroyer, a French frigate and various merchant vessels were nearby.
The Iranian Revolutionary Guard vessels gave "only 23 minutes of advance notification," Raines said.
He added that the test was an exception to the normally professional, safe and routine interactions between Iranian forces and the US Navy, and jeopardized the "freedom of navigation and maritime safety in the global commons."
A report by US broadcaster NBC news earlier said one rocket came within 1,500 meters (1,640 yards) of the USS Truman as it was crossing the strait. NBC quoted a US military official as saying the rockets were unguided and fired from fast and short attack vessels of the Iranian Revolutionary Guard.
Iranian media did not immediately report on the incident, which comes amid a thaw in US-Iranian relations following the signing of a landmark nuclear deal in July of this year that envisages the lifting of international sanctions on Tehran in exchange for cutbacks in its nuclear program.
The deal was struck amid fears on the part of several Western nations that Iran has been developing nuclear weapons under the guise of what it calls a purely civil atomic program.