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

Read More