(CNN)The UK-flagged oil tanker Stena Impero has left Iran, where it has been detained since July 19, arriving in international waters on Friday.
The ship sailed from Bandar Abbas port at 9 a.m. local time, Iran's state-run news agency IRNA reported. The company operating the ship, Stena Bulk, also confirmed the tanker's release.
"The vessel has left the port of Bandar Abbas and is transiting to Dubai for the crew to disembark and receive medical checks and de-briefing," the president and CEO of Stena Bulk, Erik Hanell, said in a statement.
"The families of crew members have been informed and the company is currently making arrangements for the repatriation of its valued seafarers at the earliest possible opportunity," Hanell added.
Iran's Revolutionary Guards forces captured the ship in the Strait of Hormuz in July amid increasing hostility between Tehran and the West. Twenty-three crew members -- none of them British -- were on board.
UK Foreign Secretary Dominic Raab reiterated criticism of Iran on Friday, saying that the ship's detainment was "part of a pattern of attempts to disrupt freedom of navigation."
In a statement, Raab again said Iran "unlawfully" seized the ship in July. "We are working with our international partners to protect shipping and uphold the international rule of law," the statement also said.
In recent weeks, London and Tehran have intensified talks. On Tuesday, UK Prime Minister Boris Johnson met Iranian President Hassan Rouhani on the sidelines of the United Nations General Assembly.
Johnson called for the immediate release of Nazanin Zaghari Ratcliffe and other dual nationals imprisoned in Iran, according to a Downing Street spokesperson.
In late August, the UK released an Iranian tanker off the coast of Gibraltar, a British overseas territory on the edge of southern Spain.
Gibraltar authorities released the Iranian ship despite 11th-hour efforts by the United States to halt the move.
While Stena Impero was sailing under a UK flag, the company that operates it is headquartered in Sweden. Earlier this month, seven Indian crew members aboard the tanker were released.
Meanwhile, on Sunday, Johnson accused Iran of being behind the September 14 attacks on Saudi oil facilities, reported the UK's PA Media news agency.
Johnson said he wanted to "deescalate tensions," but did not rule out military action if asked to take a role by Saudi Arabia or the United States, PA reported. Iran has denied responsibility for the attack.