Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A U.S. warship fired warning shots at Iranian boats approaching the destroyer at high speeds as it sailed through the Strait of Hormuz, according to the Pentagon.

The USS Mahan was travelling through the passage of water which separates the United Arab Emirates and Iran when the vessels came within 900 yards of it on Sunday, officials said.

USS Mahan U.S. Navy, file

The Pentagon said the U.S. Navy repeatedly tried to contact the boats by radio, but there was initially no response.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The crew of the Mahan also used smoke deterrent and loud horns to warn the boats off, but they continued to approach until warning shots were fired, according to officials.

The Iranians subsequently responded via radio. The Pentagon said no one was hurt.The Mahan was transiting with two other ships — the USS Makin Island, and the USNS Walter S. Diehl.

A defense official told NBC News that Iran is conducting a military exercise in the area and that they have a larger number of small craft in the Strait of Hormuz than usual.

The Navy occasionally has confrontations with Iranian naval forces in the Persian Gulf but they do not usually reach the point of prompting warning shots by the U.S.

Map showing the location of the Strait of Hormuz.

During a single week in August, the U.S. fired warning shots at Iranian vessels in similar circumstances on two separate occasions in the Strait of Hormuz.

In November, there was more tension in the same waters when an Iranian Navy boat trained its gun at a passing U.S. military helicopter.

The incident comes as President-elect Donald Trump prepares to take office on Jan. 20.

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