(CNN) Armed Iranian boats unsuccessfully tried to seize a British oil tanker in the Persian Gulf Wednesday, according to two US officials with direct knowledge of the incident.

The British Heritage tanker was sailing out of the Persian Gulf and was crossing into the Strait of Hormuz area when it was approached by boats from the Iranian Islamic Revolutionary Guard Corps.

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."

The British warship HMS Montrose docked in the Cypriot port of Limassol on February 3, 2014.

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.

The incident is yet another flashpoint in a series of maritime episodes involving Iran, coming less than a week after British Royal Marines stormed an Iranian ship that was suspected of carrying oil to Syria. Just last month, tensions between the US and Iran escalated into a military standoff after an American drone was shot down by Iran over the Straight of Hormuz.

At the same time, concerns are rising in Europe and the United States after Iran began increasing uranium enrichment after saying it would no longer comply with the nuclear agreement it signed in 2015. The US pulled out of the nuclear deal in 2018 and reintroduced economic sanctions.

The Grace 1 super tanker near a Royal Marine patrol vessel off Gibraltar on July 4.

Iranian President Hassan Rouhani warned earlier Wednesday that the UK "will see the consequences" after Gibraltar officials and UK Royal Marines seized an Iranian oil tanker bound for Syria last week, according to Rouhani's press office.

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 working to strengthen maritime security in region

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.

Heightened tensions

The alleged Iranian attempt to seize the British tanker comes amid heightened tensions between Washington and Tehran.

Earlier on Wednesday President Donald Trump announced on Twitter that sanctions on Iran will "soon be increased, substantially!" following news that Iran was enriching uranium beyond the limits imposed by the Iran Nuclear Deal.

President Trump signs an executive order imposing fresh sanctions on Iran in the Oval Office on June 24.

Last month Trump halted plans for a military strike against Iran in retaliation for the shooting down of a US drone, Trump said he found it hard to believe it had been an "intentional" act. "I think that it could have been somebody who was loose and stupid that did it," Trump said in the Oval Office on June 20.

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.