Iran's marine and port authority said the Stena Impero left Iran Friday morning. Hours earlier, the tanker had begun transmitting its location for the first time in weeks just outside the Iranian port of Bandar Abbas, where it had been held since its July 19 seizure.
The head of the Swedish shipping firm Stena Bulk that owns the tanker said it "has been a long wait" for the vessel and its crew to be released.
Company president and CEO Erik Hanell said the ship's seizure "has meant an enormous pressure for us all, especially for the crew." The ship was headed to Dubai, where the crew would disembark and undergo medical checks.
Hannel said the vessel appeared to be in good condition and "hopefully it will be on duty within a week or so," speaking by telephone with Swedish television.
The ship tracking website MarineTraffic.com showed the Stena Impero heading south from Iran at a speed of just over 14 mph (22 kph).
Iran seized the tanker on July 19 in the Strait of Hormuz, the narrow mouth of the Persian Gulf through which 20% of all oil passes. The raid saw commandos rappel down onto the vessel via helicopter carrying assault rifles, dramatic images later replayed on state television.
The seizure came after British marines helped take control of an Iranian supertanker on July 4. Authorities in Gibraltar, a British overseas territory, seized the ship carrying $130 million in crude oil on suspicion it was breaking European Union sanctions by taking the oil to Syria. Gibraltar later released the tanker, then called the Grace 1, after it said Iran promised the ship wouldn't go to Syria.
That ship, renamed the Adrian Darya 1, later sat off the Syrian coast, angering Britain. Iran hasn't said who purchased its 2.1 million barrels of crude oil.
On Monday, Iranian government spokesman Ali Rabiei had told journalists the Stena Impero could leave. But the ship remained outside Bandar Abbas until Friday.
Earlier this month, Iran released seven crew members of the Stena Impero. Sixteen stayed on board.
Britain has responded to Iran's release of the tanker Friday by accusing Tehran of trying to disrupt freedom of navigation.
U.K. Foreign Secretary Dominic Raab said the ship "was unlawfully seized by Iran."
He said the seizure was "part of a pattern of attempts to disrupt freedom of navigation. We are working with our international partners to protect shipping and uphold the international rule of law."
The ship seizures come after months of heightened tensions in the Persian Gulf, sparked by President Donald Trump's decision over a year ago to unilaterally pull out of a nuclear deal with Iran. The U.S. has imposed sanctions that have kept Iran from selling its oil abroad and have crippled its economy. Iran has since begun breaking terms of the deal.
Iranian President Hassan Rouhani on Friday told reporters upon his return home from the U.N. General Assembly that U.S. sanctions on Iran are "more unstable than ever," without elaborating. Many observers saw the trip as an opportunity for a possible meeting between Rouhani and Trump.
But Rouhani said Iran cannot accept negotiations before the U.S. sanctions are lifted first. "Otherwise, Iran does not fear negotiation," he said.
Meanwhile, Trump tweeted Friday that "Iran wanted me to lift the sanctions imposed on them in order to meet. I said, of course, NO!"
There have been a series of attacks across the Middle East that the U.S. blames on Iran. They reached their height on Sept. 14, with a missile and drone attack on the world's largest oil processor in Saudi Arabia and an oil field, which caused oil prices to spike by the biggest percentage since the 1991 Gulf War. While Yemen's Iranian-allied Houthi rebels claimed the assault, Saudi Arabia says it was "unquestionably sponsored by Iran."
Iran denies being responsible and has warned any retaliatory attack targeting it will result in an "all-out war."