WASHINGTON — A US Coast Guard vessel had a tense encounter with an Iranian fishing boat in the Persian Gulf on Tuesday and fired a warning shot, the Pentagon said.

The Coast Guard cutter Monomoy sent a small, inflatable boat to approach the Iranian dhow and when it got close, the Americans spotted two 50-caliber machine guns, with one of the guns aimed at them, US military officers said.

“They saw that one of the machine guns was manned and trained on them,” Lieutenant Joseph Hontz, a spokesman for the US Fifth Fleet, told AFP.

The Americans pulled back and fired one warning shot, he said, while the Iranian vessel headed off.

“In any event, the dhow pulled away and nobody was hurt,” Pentagon spokesman Rear Admiral John Kirby told reporters.

He said the Coast Guard vessel was on a “routine maritime security operation.”

The brief incident took place in the Gulf at 11:30 a.m.

The United States and Iran are arch-foes and American naval ships and Iranian vessels over the past decade have had occasional tense confrontations in the Strait of Hormuz and the Gulf.

Washington accused Iran of sending speedboats in close to harass American naval ships in 2007 and 2008.