A U.S. Navy ship fired warning shots at an Iranian ship in the Persian Gulf on Tuesday, two U.S. defense officials confirmed to Fox News.

The American coastal patrol ship fired warning shots from its .50-caliber machine gun at an Iranian patrol boat when it came within 150 yards of the U.S. vessel, the officials said.

The Iranian Islamic Revolutionary Guard Corps ship ignored repeated radio calls from the USS Thunderbolt, which also launched flares and sounded the danger signal – five short blasts – to warn the fast-approaching Iranian ship, officials said.

The incident occurred as a formation of U.S. Navy warships was conducting an exercise in the Northern Persian Gulf. It’s also the first time since President Trump took office in January that a U.S. ship has fired warning shots at an Iranian ship.

"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," the U.S. Navy said in a statement.

"We see increased aggression all over the world," said Rep. Mac Thornberry, R-Tex., the chairman of the House armed services committee. "Recently, we also had aggressive activity by the Chinese. Of course, we've seen a pattern of this from the Russians. And now the Iranians. So it's clear people are testing us from all around the world."

The U.S. military has recorded approximately 60 unsafe interactions with Iranian ships in the Gulf since 2015. Congress was set to vote on new sanctions on Iran on Tuesday afternoon.