The official, speaking on the condition of anonymity, said three warning shots were fired from a .50 calibre gun on Wednesday (local time) after warning flares did not work.
The incident started with three Iranian vessels, but there was only one Iranian vessel around by the time the warning shots were fired, the official said.
The official added that at one point an Iranian vessel came within 200 metres of a US ship.
The United States on Wednesday had reported another incident in which it said Iranian vessels harassed a US warship near the Strait of Hormuz earlier this week.
"At this point, it's not clear what the intentions of the Iranian ships were, but the behaviour is not acceptable, given that this US ship was in international waters," White House spokesman Josh Earnest said about the incident in the Strait of Hormuz.
"These types of actions and incidents are concerning and they have the potential to unnecessarily escalate tensions."