The British-flagged tanker seized by Iran’s Revolutionary Guards more than two months ago has been released, according to Iranian officials.

“The legal process has finished and based on that the conditions for letting the oil tanker go free have been fulfilled and the oil tanker can move,” Ali Rabiei, Iran’s government spokesman, said on Monday, according to the official IRNA news agency.

The Stena Impero’s Swedish owners are yet to confirm the vessel has been freed from the port city of Bandar Abbas, but had said on Sunday its release was imminent.

The decision to release the vessel comes a day before a meeting between Iran’s president, Hassan Rouhani, and the British prime minister, Boris Johnson, on the sidelines of the UN general assembly in New York.

Analysts said the timing of the announcement could be aimed at generating some goodwill ahead of the international meeting in which the Islamic Republic is expected to face pressure over allegations it carried out or supported last week’s missile and drone attacks on Saudi Arabian oil infrastructure.

Johnson was asked at the UN meeting on Monday about the attacks. “How do we respond to what the Iranians plainly did? What the UK is doing is trying to bring people together and de-escalate tensions,” he told Sky.

The Stena Impero was dramatically seized on 19 July as it passed through the strait of Hormuz after Iranian officials claimed it had infringed maritime regulations. Footage released by Iran showed Revolutionary Guards descending from a helicopter to take control of the ship and detain its 23 crew members.

About two weeks earlier, British Royal Marines seized an Iranian supertanker off the coast of Gibraltar carrying 2.1m barrels of crude oil that UK authorities alleged was to be sold to Syria in breach of EU sanctions against Bashar al-Assad’s government. Iran has denied the Stena Impero’s impoundment was a tit-for-tat move.

The takeover, which led the UK to advise its ships to temporarily avoid the strait of Hormuz, was part of a wave of sabotage attacks and seizures of ships over the past six months in and around the narrow waterway through which more than a quarter of the world’s oil supply passes.

The US and Gulf states have blamed Iran for the incidents, including the alleged use of explosives against four oil tankers in the Gulf of Oman in May, suspicious fires on two tankers in the same area in June and the attempted seizure of a British vessel in July, allegedly by Iranian boats that were driven off by a Royal Navy warship.

A Gibraltar court ordered the release of the Iranian vessel, then called Grace and since renamed Adrian Darya 1, on 18 August after receiving written assurances from Iran that it would not head to countries under EU sanctions.

The Adrian Darya switched off its transported near the Syrian coast earlier this month. Satellite imagery of the ship analysed by the independent service TankerTrackers showed the vessel near the Syrian port of Tartus on Sunday, casting a thin shadow that suggested it could still be laden with oil.

TankerTrackers.com, Inc.⚓️🛢 (@TankerTrackers) As we were asked last night whether or not the #AdrianDarya1 is still full of oil or not, here is yesterday's @planetlabs RapidEye (5m/pixel) constellation imagery which we have converted to b&w without enhancement. Thin shadow indicating she was still full at 11:00am local time. pic.twitter.com/s7GFuQSqIF

That would contradict assessments by the UK, which has said it believes the oil onboard the ship has been sold to Assad’s regime, as well as claims by Iranian officials that Adrian Darya’s cargo was sold to a private company in a ship-to-ship transfer.

The Islamic republic’s oil exports have fallen from about 2m barrels per day in August 2018 to about 160,000 barrels a day after the US imposed sanctions in November.

Washington is seeking to force Tehran to negotiate a new nuclear deal to replace the 2015 agreement that Donald Trump unilaterally pulled out from in May last year.

Trump said the deal, which traded curbs in Iran’s nuclear programme for relief from sanctions, needed to also address Iranian missile development, human rights abuses and sponsorship of proxies. Iran had been in full compliance with the agreement when it was breached by the US.

In his Sky interview in New York on Monday, Johnson echoed Washington’s position in calling for Tehran to return to the negotiating table. “Whatever your objections to the old nuclear deal with Iran, it’s time now to move forward and do a new deal,” he said.

The incidents in the strait of Hormuz have led the US to create the international maritime security construct, an alliance of countries including Bahrain, Australia and the UK, whose vessels are trying to deter Iranian intervention against oil tankers in the area.

Saudi Arabia and the UAE have both signed up to the construct in the past week since the attack on Saudi oil facilities that the kingdom said involved Iranian-made weapons.