Updated 1:10 p.m. E.T.

A U.S. patrol ship fired warning shots from a heavy machine gun Tuesday towards a fast-approaching Islamic Revolutionary Guard Corps Navy craft in the Persian Gulf, stopping the vessel less than 150 yards away, a Pentagon official told news agencies Tuesday.

The USS Thunderbolt fired into the water in an effort to avoid a collision after the Iranian craft ignored multiple flares, attempts at radio contact and whistle blasts, the official said. The ship was taking part in an exercise with American and other coalition vessels in international waters when it was approached by the Iranian patrol boat.

“As the Iranian vessel proceeded toward the U.S. ship, Thunderbolt again sounded five short blasts prior to firing warning shots in front of the Iranian vessel. After the warning shots were fired, the Iranian vessel halted its unsafe approach,” Pentagon spokesman Major Adrian Rankine-Galloway said in a statement released by Central Command.

“The Iranian vessel’s actions were not in accordance with the internationally recognized COLREGs ‘rules of the road’ nor internationally recognized maritime customs, creating a risk for collision,'” Rankine-Galloway said.

The incident is just the latest low-level altercation between U.S. and Iranian naval ships in the Persian Gulf, where both sides have traded accusations of provocative and unsafe behavior.

“It is out of the norm for them to come in that close at that rate of speed,” a defense official told The Military Times on the condition of anonymity. “We had to act for the safety of the crew.”

The U.S. Navy claims there have been 35 instances of what it calls “unsafe and/or unprofessional” interactions with Iranian forces in 2016, and 23 cases in 2015.

In March, Mehdi Hashemi, a senior official in Iran’s elite Revolutionary Guard, accused the U.S. of provoking tensions in two separate incidents in the Gulf in the span of one week.

The most high-profile recent dispute came in January 2016, when Iran’s Revolutionary Guard briefly detained 10 US sailors — nine men and one woman — and accused them of “snooping around” in Iranian waters.