Five boats thought to be Iranian tried to stop a British oil tanker in the Strait of Hormuz, according to US officials.
The boats withdrew after a warning from a British warship operating in the area.
US officials said the incident happened as one of the UK’s tankers, British Heritage, was at the northern entrance of the Strait.
“The Royal Navy HMS Montrose, which was also there, pointed its guns at the boats and warned them over radio, at which point they dispersed,” one of the officials said.
“It was harassment and an attempt to interfere with the passage,” another official said.
The incident comes as the HMS Montrose warship was said to be offering extra protection to British Heritage in the Gulf following a threat from Iran to seize a British vessel.
Tensions have been rising since Royal Marines helped seize an Iranian-flagged tanker in Gibraltar which was allegedly carrying oil to Syria, in breach of European Union sanctions.
The capture of the Grace 1 tanker prompted Iranian President Hassan Rouhani to warn the UK of “consequences”.
“You (Britain) are the initiator of insecurity and you will realise the consequences later,” Rouhani said after a cabinet meeting on Wednesday, according to the semi-official news agency Tasnim.
Brigadier General Amir Hatami also warned the UK its actions “will not go without a response”.
Tehran claimed the detention was an “illegal interception” and have demanded the tanker’s release.
But Gibraltar officials believe the 330m (1,000ft) tanker could have been carrying up to two million barrels of oil destined for Syria.
Iran has denied this and said the boat was headed “somewhere else”.
Gibraltar’s supreme court ruled last week the tanker could be held for another 14 days, the territory’s attorney general said.
The United States has been leading a push for allies and other tankers that use the Strait of Hormuz to increase their maritime security in the region, safeguarding strategic waters off Iran and Yemen.
It alleges that Tehran was behind attacks on six oil tankers in the area.
Relations between the two countries have fractured since President Donald Trump pulled the US out of a nuclear deal with Iran and re-imposed sanctions.