Three Iranian boats tried to stop a British oil tanker in the Strait of Hormuz, Britain's Ministry of Defence has said.
The boats withdrew after a warning from a British warship operating in the area.
In a statement, a UK government spokesman said they were "concerned" by the incident and urged Iranian authorities "to de-escalate the situation in the region".
The spokesman said: "Contrary to international law, three Iranian vessels attempted to impede the passage of a commercial vessel, British Heritage, through the Strait of Hormuz.
"HMS Montrose was forced to position herself between the Iranian vessels and British Heritage and issue verbal warnings to the Iranian vessels, which then turned away.
"We are concerned by this action and continue to urge the Iranian authorities to de-escalate the situation in the region."
Initial reports from US officials suggested that five Iranian vessels were involved in the incident.
"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.
Tensions have been rising since British 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 Britain that 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".
The US 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 US President Donald Trump pulled the country out of a nuclear deal with Iran and re-imposed sanctions.