A U.S. Navy destroyer fired three warning shots at four Iranian fast-attack vessels after they closed in at a high rate of speed near the Strait of Hormuz, two U.S. defence officials told Reuters.

The incident, which occurred Sunday and was first reported by Reuters, comes as U.S. President-elect Donald Trump prepares to take office on 20 January. In September, Mr Trump vowed that any Iranian vessels that harass the U.S. Navy in the Gulf would be "shot out of the water”.

The officials, speaking on the condition of anonymity, said the USS Mahan established radio communication with the Islamic Revolutionary Guard Corps boats but they did not respond to requests to slow down and continued asking the Mahan questions.

The Navy destroyer fired warning flares and a U.S. Navy helicopter also dropped a smoke float before the warning shots were fired.

The Iranian vessels came within 900 yards (800 meters) of the Mahan, which was escorting two other U.S. military ships, they said.

The IRGC and Trump transition team were not immediately available for comment.

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

One official said similar incidents occur occasionally.

Most recently in August, another U.S. Navy ship fired warning shots towards an Iranian fast-attack craft that approached two U.S. ships.

In January 2016, Iran freed 10 U.S. sailors after briefly detaining them in the Gulf.

The official added that the warning shots fired on Sunday were just one of seven interactions the Mahan had with Iranian vessels over the weekend, but the others were judged to be safe.