A U.S. Navy ship fired warning shots when an Iranian vessel in the Gulf came within 150 yards (137 meters) on Tuesday in the first such incident since President Donald Trump took office in January, a U.S. official told Reuters.

The last major incident was earlier in January, though there have been other instances when a U.S. vessel fired a flare and another event in March when a U.S. Navy ship was forced to change course after multiple fast-attack vessels from the Islamic Revolutionary Guard came too close.

The U.S. official, speaking on condition of anonymity, said the USS Thunderbolt fired the warning shots after the Iranian vessel approached at a high rate of speed and ignored radio calls, flares and the ship's whistle. The Thunderbolt was accompanied by several U.S. Coast Guard vessels.

The Iranian vessel appeared to be from Iran's Islamic Revolutionary Guard Corps, the official said, adding that it was armed but that the weapons were unmanned.

The Islamic Revolutionary Guard Corps and Iranian Foreign Ministry could not immediately be reached for comment.

Years of mutual animosity had eased when Washington lifted sanctions on Tehran last year as part of a deal to curb Iran's nuclear ambitions. But serious differences remain over Iran's ballistic missile program and conflicts in Syria and Iraq.

The Trump administration, which has struck a hard line on Iran, recently declared that Iran was complying with its nuclear agreement with world powers, but warned that Tehran was not following the spirit of the accord and that Washington would look for ways to strengthen it.

During the presidential campaign last September, Trump vowed that any Iranian vessels that harass the U.S. Navy in the Gulf would be "shot out of the water."

Such incidents occur occasionally. In January, a U.S. Navy destroyer fired three warning shots at four Iranian fast-attack vessels near the Strait of Hormuz after they closed in at high speed and disregarded repeated requests to slow down.