A U.S. Navy destroyer fired a warning flare at an Iranian Revolutionary Guard ship in the Persian Gulf, an American official said on Wednesday.
The incident occurred on Monday. The Iranian ship was approaching the USS Mahan even though the destroyer was trying to turn away.
Lt. Ian McConnaughey, fleet spokesman, said the Mahan tried to contact the Iranian ship, issued warning messages and sounded the "internationally recognized the danger signal" to urge the ship to turn away.
The Iranian ship came within a kilometer of the Mahan before ultimately turning and sailing away.
Iranian officials did not immediately report the incident.
The U.S. and Iran routinely have close encounters in the Gulf. Iran views the U.S.' presence there as a provocation and occasionally fires missiles or rockets nearby. In one incident, Iranian forces captured 10 U.S. sailors and held them overnight. Such incidents have increased since the signing of the Iran nuclear deal.
The Associated Press contributed to this report.