A U.S. Navy ship fired three warnings shots at Iranian boats near the Strait of Hormuz on Sunday, Pentagon spokesman Capt. Jeff Davis said.

Four Islamic Revolutionary Guard Corps attack craft vessels were “traveling right at” the USS Mahan in the Strait of Hormuz at a "very high rate of speed,” a defense official, speaking on condition of anonymity, told VOA earlier Monday.

The crew identified themselves as part of the U.S. Navy, and repeated “multiple times” that the ships needed to turn away or the crew would be “forced to use a defensive measure,” the official said. Capt. Davis said the USS Mahan crew issued used audible sirens and issued radio warnings.

“This was an unsafe and unprofessional interaction,” Davis said, “and that’s due to the fact that they were approaching with a high level of speed with weapons manned and disregarding repeated warnings.”

When the Iranian boats did not respond to radio requests to slow down, the USS Mahan fired shots with a .50 caliber machine gun.

“As soon as the crew fired off warning shots, the small Iranian boats stopped and the U.S. ships proceeded on their route,” the defense official said. The Iranian boats came within about 825 meters of the USS Mahan, according to Davis.

The Navy destroyer was escorting the USS Makin Island, an amphibious ship, and the USNS Walter S. Diehl, a supply ship, during the time of the incident.

The Navy destroyer was escorting the USS Makin Island, an amphibious ship, and the USNS Walter S. Diehl, an oil supply ship, during the time of the incident.

A defense official told VOA the U.S. encourages Iran and all nations to operate in accordance with internationally recognized maritime laws, standards and norms.

“Our commanding officers are obligated to act in self-defense. Such unsafe and unprofessional interactions with IRGCN vessels create a risk of escalation and are entirely preventable with proper seamanship,” the official said.