An Iranian oil tanker held for six weeks after being impounded left Gibraltar on Sunday, after the authorities in the British territory rejected a request from American officials to turn the vessel over to them, the latest development in an episode that has contributed to raised tensions between Iran and the West.

A marine traffic monitoring website showed the tanker, the Grace 1, leaving Gibraltar’s waters shortly after 11 p.m. local time, with a destination of Kalamata, a port city in southern Greece, a move that has raised hopes that Iran will now release a British-flagged ship.

The Iranian vessel is expected to arrive in Greece on Sunday, according to the tracker. News organizations in Iran and Gibraltar confirmed that the ship had left Gibraltar, and Iran issued a warning soon afterward that any attempt by the United States to detain the tanker would have consequences.

The ship was renamed Adrian Darya-1, with its new moniker hastily painted onto the side of the vessel in white lettering seen in images taken shortly before it left the port, with “Grace 1” painted over in black.