DUBAI, United Arab Emirates — A U.S. Navy patrol boat fired warning shots Tuesday near an Iranian vessel that American sailors said came dangerously close to them during a tense encounter in the Persian Gulf, the first such incident to happen under President Donald Trump. Iran’s hard-line Revolutionary Guard later blamed the American ship for provoking the situation.

The encounter involving the USS Thunderbolt, a Cyclone-class patrol ship based in Bahrain as part of the U.S. Navy’s 5th Fleet, comes as Trump has threatened to renegotiate the nuclear deal struck by his predecessor and after his administration put Iran “on notice” over its ballistic missile tests.

The Thunderbolt was taking part in an exercise with American and other coalition vessels in international waters when the Iranian patrol boat approached it, 5th Fleet spokesman Lt. Ian McConnaughey said. The Iranian ship did not respond to radio calls, flares and horn blasts as it came within 150 yards of the Thunderbolt, forcing the U.S. sailors aboard to fire the warning shots, McConnaughey said.

“After the warning shots were fired, the Iranian vessel halted its unsafe approach,” the lieutenant said in a statement, adding that the Iranian vessel created “a risk for collision.” Large ships can’t stop immediately on the water.

Video released by the Navy included a sailor giving a position off the eastern coast of Kuwait as the Iranian vessel sat directly in front of an American warship’s bow. Another video included images of the Iranian ship off the Thunderbolt as its horn blared. The sound of machine-gun fire followed.

Iran’s paramilitary Revolutionary Guard instead blamed the Thunderbolt for the incident in a statement, saying the American vessel moved toward one of its patrol boats. It said the Thunderbolt fired into the air “with the intention to provoke and create fear.”

advertisement | advertise on newsday

Iran and the United States frequently have tense naval encounters in the Persian Gulf, nearly all involving the Revolutionary Guard, a separate force from Iran’s military that answers only to the country’s supreme leader. The last one to involve warning shots happened in January near the end of then-President Barack Obama’s term, when the USS Mahan fired shots toward Iranian fast attack boats as they neared the destroyer in the Strait of Hormuz.

The U.S. Navy recorded 35 instances of what it describes as “unsafe and/or unprofessional” interactions with Iranians forces in 2016, compared with 23 in 2015.

The worst incident last year involved Iranian forces capturing 10 U.S. sailors and holding them overnight. It became a propaganda coup for Iran’s hard-liners, as Iranian state television aired footage of the Americans on their knees, their hands on their heads.