According to CNN, the USS Vella Gulf and two other US ships were accompanying the Thunderbolt at the time of the incident.
Iran unveiled its latest air defence missiles on Saturday.
The Iranian ship continued its approach and the USS Thunderbolt again sounded five short blasts, and then warning shots in front of the Iranian vessel.
Czech judges denounce Poland's legal overhaul as attack on freedom
Sources close to the Presidential Palace told Reuters news agency that President Andrzej Duda was on holiday on the Baltic coast. It calls for the dismissal of the court's current judges, except those chosen by the president.
There will be "serious consequences" unless Iran releases American prisoners and stops using "hostage taking as a tool of state policy", Mr Trump said recently.
The unidentified Iranian Revolutionary Guard Corps vessel got within 200 yards of the USS Thunderbolt before the American patrol boat fired a warning shot, quickly ending the encounter.
The vessel from Iran's Islamic Revolutionary Guard Corps (IRGC) "conducted an unsafe and unprofessional interaction" with the coastal patrol ship USS Thunderbolt as it participated in a military exercise in the global waters of the northern Arabian Gulf. This is also the closest that an Iranian vessel has come to a USA ship in the Gulf in at least a year.
USA officials also have not disclosed what type of weapons the crew fired.
Palestinian shot dead in attempted stabbing attack in West Bank
But after consultations with security chiefs and members of his security cabinet, Mr Netanyahu decided not to order them removed. Israel sealed off the site in the aftermath of the attack, saying the closure was necessary to carry out security checks .
USA officials did not specify the size or type of the Iranian vessel, only speculated that it may have been operated by the naval branch of the Islamic Revolutionary Guard Corps (IRGC).
Naval incidents with Iran are not entirely unusual, though ones involving shots fired are.
Incidents between U.S and Iranian maritime forces are not uncommon in the region.
The warning shots come as tensions between the two countries have heightened, spurred on in part by anti-Iran rhetoric from President Donald Trump.
One month away from total solar eclipse: What to expect
The last total solar eclipse that was visible in the lower 48 of the United States was in February 1979, according to NASA . It will take about an hour and a half for the eclipse to travel across the sky from the Pacific Coast to the Atlantic.