A UK warship warned an Iranian patrol boat by radio against interfering with the Stena Impero as the British-flagged oil tanker passed through the Strait of Hormuz, an audio recording released on Sunday showed.
Iran's Islamic Revolutionary Guard Corps seized the British-flagged tanker with a crew of 23 on Friday.
The recording is of a radio exchange between a Royal Navy frigate and Iranian forces in the Gulf as they ordered the Stena Impero to change course.
The HMS Montrose tells the Stena Impero that it was in a recognised maritime Strait and did not need to comply.
The warship later tells Iranian naval forces that they "must not impair, impede, obstruct or hamper the passage of the MV Stena Impero" before the broadcast is cut over by another voice on the same radio channel.
"Please confirm you are not intending to violate international law by unlawfully attempting to board the MV Stena," the Montrose tells the Iranian radio operator.
The audio was obtained by British maritime security company Dryad Global.
Responding to the Montrose's warning not to interfere, the Iranian boat says it is acting for security purposes.
"This is Sepah Navy patrol boat. No challenge is intended, no challenge is intended. I want to inspect the ship for security reason."
The Sepah Navy is a special unit of the Islamic Revolutionary Guard Corps.
The UK told the UN Security Council on Saturday that the tanker seized by Iran was approached when it was in Omani territorial waters and the action "constitutes illegal interference".
"The ship was exercising the lawful right of transit passage in an international strait as provided for under international law," Britain's UN mission wrote to the Security Council.
"International law requires that the right of transit passage shall not be impeded and therefore the Iranian action constitutes illegal interference."
The letter was also sent to UN Secretary General Antonio Guterres.
The seizure of the tanker was in "clear violation of international law", the head of the UK Chamber of Shipping said on Sunday.
"The chart released by Her Majesty's government today clearly demonstrates that the Swedish-owned and British-flagged tanker, Stena Impero, was in Oman territorial waters when she was boarded by the Iranian Revolutionary Guard on Friday, July 19," Bob Sanguinetti said.
"The evidence provided is proof that the seizing of the Stena Impero was in clear violation of international law."
Mr Sanguinetti said there was no comparison to be made with the seizure of Grace I off Gibraltar on its way to Syria, which was done under international law for the breach of EU sanctions on Damascus.
The Montrose was alerted that the Iranian guards were trying to apprehend the vessel but was too far away to intervene, arriving on scene shortly after the ship had been taken into Iranian waters.
The Iranian navy told the Stena Impero to change course, and that "if you obey you will be safe".
The UK said there was no evidence to support Iran's claims that the Stena Impero had collided with a fishing vessel.
Stena Bulk, the British operator of the Stena Impero, has made a formal request to visit the 23 crew members and is awaiting a response, it said on Sunday.
Friday's action in the global oil trade's most important waterway has been viewed in the West as a major escalation after three months of confrontation that has taken Iran and the US to the brink of war.
British Foreign Secretary Jeremy Hunt called the French and German foreign ministers, Jean-Yves Le Drian and Heiko Maas, on Sunday to discuss the detention of the vessel.
Mr Le Drian and Mr Maas condemned the Iranian seizure of Stena Impero.
The three European ministers agreed that safe passage for vessels through the Strait of Hormuz was "a top priority for European nations", while avoiding any escalation in the region.
In an interview to Bild newspaper on Sunday, Mr Maas warned Iran that its seizure of commercial vessels could lead to war.
He said that the seizure of British tankers on Friday has made the situation in the Gulf “a lot more serious and dangerous than it has been".
“There can be no winners, only losers, in a possible uncontrolled military escalation,” he said.
Mr Maas called on Iran’s leaders to fulfil “their responsibilities and not continue with this escalation spiral".
He said Europe was focused on keeping diplomatic channels open with “voices of reason”, despite the challenges involved.
“This is about preventing war,” Mr Maas said.
The incident follows threats from Tehran to retaliate against Britain seizing the Iranian tanker Grace 1 on July 4.
"Current tensions are extremely concerning and our priority is to de-escalate," said Britain's letter to the Security Council. "We do not seek confrontation with Iran.
"But it is unacceptable and highly escalatory to threaten shipping going about its legitimate business through internationally recognised transit corridors."
Britain called on Iran to release the Stena Impero tanker and told the UN it was working to resolve the issue through diplomatic means.
UK Foreign Secretary Jeremy Hunt said the action was "totally and utterly unacceptable" and a "clear contravention of international law".
British Defence Secretary Penny Mordaunt said Iran's move was a "hostile act".
Despite the strong statements from UK officials, Mr Hunt said the solution would be found through diplomacy and London was "not looking at military options".
But the government said it advised British shipping companies to stay out of the Strait of Hormuz for a time.
UK ministers are making plans to hit Iran with sanctions over the seizure, The Daily Telegraph reported.
Mr Hunt is expected to announce diplomatic and economic measures, possibly including asset freezes, on Sunday as a response to the incident.
Other nations condemned Iran's seizure of the vessel. Saudi Arabia's Minister of State for Foreign Affairs, Adel Al Jubeir, said on Sunday night that Iran must be aware that its actions were completely unacceptable.
"Any attack on the freedom of navigation is a violation of international law," Mr Al Jubeir said on Twitter.
“Iran must realise its acts of intercepting ships, including most recently the British ship, are completely unacceptable. The world community must take action to deter such behaviour."
Until now, the UK has backed plans to protect the 2015 Iran nuclear deal after the US withdrew last year and reimposed sanctions on Tehran.
In response, European signatories of the deal established a new trading mechanism to circumvent the US embargo and tried to keep Iran in compliance with the agreement.
But the latest move could change the UK's position on this. The EU has publicly backed the UK, although statements have simply called for the Stena Impero to be released and stopped short of condemning Iran.
Iranian state TV on Sunday quoted officials saying all crew members of the Stena Impero were "safe and in good health".
While Iran often parades hostages and foreign nationals involved in international incidents on TV, the crew has not been shown.
They are from India, Latvia, the Philippines and Russia. The Philippines and India have said they are negotiating to secure the release of their nationals.
In 2016, the Revolutionary Guards seized two US Navy command boats that strayed into Iranian waters by mistake.
While the sailors were released unharmed 15 hours later, Iranian media ran photos of the men while they were being held.
It also broadcast footage of one of the sailors apologising for the incident and saying they were being treated well by Iranian guards.
Meanwhile, an Iranian tanker held in Saudi Arabia after being forced to seek repairs at Jeddah port was released and was returning to Iran.
The Happiness 1 tanker "has been released following negotiations and is now moving toward Gulf waters", Iranian Transport Minister Mohammad Eslami told state news agency Irna on Sunday.
The ship had been forced to seek repairs in Saudi Arabia in early May after engine failure and loss of control.