Iranian boats tried to impede a British oil tanker near the Gulf - before being driven off by a Royal Navy ship, the Ministry of Defence has said.
HMS Montrose, a British frigate shadowing the BP-owned tanker, was forced to move between the three boats and the tanker, a spokesman said.
He described the Iranians' actions as "contrary to international law".
Iran had threatened to retaliate for the seizure of one of its own tankers, but denied any attempted seizure.
Boats believed to belong to Iran's Islamic Revolution Guard Corps (IRGC) approached the tanker, British Heritage, and tried to bring it to a halt as it was moving out of the Gulf into the Strait of Hormuz.
Guns on HMS Montrose were trained on the Iranian boats as they were ordered to back off, US media reported. The boats heeded the warning and no shots were fired.
The BBC has been told British Heritage was near the island of Abu Musa when it was approached by the Iranian boats.
Although Abu Musa is in disputed territorial waters, HMS Montrose remained in international waters throughout.
Defence Secretary Penny Mordaunt said the government was concerned by the incident and urged the Iranian authorities to "de-escalate the situation".
Foreign Secretary Jeremy Hunt added the UK would monitor the situation "very carefully".
Prime Minister Theresa May's official spokesman said the government was "committed to maintaining freedom of navigation in accordance with international law".
What does Iran say?The navy of Iran's Islamic Revolution Guard Corps has denied claims it tried to seize the tanker, Iranian news agencies reported. IRGC's navy said there had been no confrontation with any foreign vessels in the past 24 hours.
Iranian foreign minister Mohammad Javad Zarif said the UK made the claims "for creating tension".
"These claims have no value," Mr Zarif added, according to the Fars news agency.
Why are UK-Iran tensions escalating?The relationship between the UK and Iran has become increasingly strained, after Britain said the Iranian regime was "almost certainly" responsible for the attacks on two oil tankers in June.
Last week, British Royal Marines helped the authorities in Gibraltar seize an oil tanker because of evidence it was carrying Iranian crude oil to Syria in breach of EU sanctions.
On Thursday an Iranian official told the BBC the seizure was "unnecessary and non-constructive escalation by the UK".
The official claimed the oil was not bound for Syria and called for the tanker to be released.
The government of Gibraltar said it would not comment on matters relating to the vessel as it was the subject of a police investigation. It said the matter was also now in the Supreme Court.
The Port of Gibraltar's live map showed the tanker, Grace 1, remained anchored about 3km off the east coast of Gibraltar.
At the time of the Gibraltar incident, Iran summoned the British ambassador in Tehran to complain about what it said was a "form of piracy".
An Iranian official said a British oil tanker should be seized if Grace 1 was not released.
On Wednesday, Iranian President Hassan Rouhani mocked the UK, calling it "scared" and "hopeless" for using Royal Navy warships to shadow another British tanker in the Gulf.
HMS Montrose had shadowed the British tanker Pacific Voyager for some of the way through the Strait of Hormuz, but that journey had passed without incident.
"You, Britain, are the initiator of insecurity and you will realise the consequences later," Mr Rouhani said.
The Royal Navy has a frigate, four minehunters and a Royal Fleet Auxiliary support ship already stationed in a permanent Naval Support Facility in the region, at Mina Salman in Bahrain.
This is enough to provide reassurance, but probably not to deal with a crisis, BBC defence correspondent Jonathan Beale said.