The Iranians ordered the tanker to change course and stop in nearby Iranian territorial waters, according to the officials. A US aircraft was overhead and recorded video of the incident, though CNN has not seen the footage.
A British Ministry of Defense source told CNN that it "appeared that the Iranian vessels were trying to divert the Heritage from international to Iranian waters" before the British Navy ship HMS Montrose "got between them and issued a verbal warning to withdraw."
US officials said five Iranian ships approached the UK vessels. However, British officials said that three Iranian vessels were involved in the incident.
The UK's Royal Navy frigate HMS Montrose had been escorting the tanker from the rear. It trained its deck guns on the Iranians and gave them a verbal warning to back away, which they did, according to the UK source. Montrose is equipped on the deck with 30 mm guns specifically designed to drive off small boats. UK officials had previously confirmed that the Montrose was in the region performing a "maritime security role."
In a statement, the UK's Ministry of Defense said that "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," the statement said. "We are concerned by this action and continue to urge the Iranian authorities to de-escalate the situation in the region."
Iran's Revolutionary Guard denied that it tried to stop the British tanker, the semi-official Fars news agency reported Thursday.
On Thursday, the British Heritage was seen moving through the Gulf of Oman along the Omani coastline, according to tracking platform Marine Traffic.
The British Heritage is a British oil tanker operated by British Petroleum. It was not carrying any cargo at the time of the incident.
The vessel left the Iraqi city of Basra on July 6 and stopped off the coast of Saudi Arabia on July 7, according to the tracker.
On July 10, the ship turned off its transponders for almost 24 hours, making it undetectable by radars. When it switched on its transponders at around 1pm Eastern Time, it appeared to have sailed through the Persian Gulf escorted by the HMS Montrose.
Rouhani, speaking in a cabinet session, said, "I tell the British that they are the initiator of insecurity and you will understand its consequences later."
US Chairman of the Joint Chiefs of Staff Gen. Joseph Dunford said Tuesday that the US and its allies were working to put together a coalition of countries to come up with a system to enforce freedom of navigation in the region amid what the US says are heightened threats from Iran.
"We had a discussion today, the Secretary of State, the Secretary of Defense and I and we are engaging now with a number of countries to see if we can put together a coalition that would ensure freedom of navigation both in the Straits of Hormuz and the Bab el Mandeb," Dunford said following an awards ceremony for his Finnish counterpart.
"I think what we'll do is, we certainly from the United States perspective would provide maritime domain awareness and surveillance," he said, adding that naval vessels would escort commercial ships that shared a country of origin, if required.
"Escorting in the normal course of events would be done by countries who have the same flag so a ship that is flagged by a particular country would be escorted by that country and I think what the United States can provide is domain awareness, intelligence, surveillance, reconnaissance and then coordination and patrols for other ships that would be in the area would be largely coalition ships," Dunford said.
The alleged Iranian attempt to seize the British tanker comes amid heightened tensions between Washington and Tehran.
The Trump administration has argued that the nuclear deal it abandoned in 2018, is inadequate as it doesn't cover Iran's ballistic missiles or regional activities.
Even though the International Atomic Energy Agency has found that Iran has complied with the deal, the US has re-imposed all sanctions in place before the deal and added new ones. Those actions have undermined the central concept of the deal -- that in exchange for controls on its nuclear program, Iran would see some economic relief.
Iran's Foreign Minister Javad Zarif tweeted Wednesday that the US has no standing to raise issues pertaining to the multilateral deal, due to the Trump administration's earlier decision to exit he deal.
US Special Representative for Iran Brian Hook told CNN Tuesday that the US is "looking for a new and better deal" to submit to the Senate as a treaty.
CNN's Nicole Gaouette, Sam Kiley and Sarah El Sirgany contributed to this report.