An Iranian tanker headed through the Mediterranean toward Greece on Monday after it was released from detention off Gibraltar, and Tehran said any U.S. move to seize the vessel again would have "heavy consequences."

The Grace 1, renamed the Adrian Darya 1, left anchorage off Gibraltar about 11 p.m. local time on Sunday. Refinitiv ship tracking data showed early on Monday that the vessel was heading to Kalamata in Greece.

The seizure of the tanker by British Royal Marines near Gibraltar in July 4 on suspicion it was carrying oil to Syria in violation of European Union sanctions led to a weeks-long stand-off between Tehran and the West. It also heightened tensions on international oil shipping routes through the Gulf.

Gibraltar, a British overseas territory, lifted the detention order on Thursday but the next day a federal court in Washington issued a warrant for the seizure of the tanker, the oil it carries and nearly $1 million US.

Iranian Foreign Minister Mohammad Javad Zarif on Monday said the warrant is "politically motivated" and Iran is not interested in talks with Washington unless the U.S. wants to have discussions about restoring the 2015 nuclear deal.

Gibraltar said on Sunday it could not comply with that request because it was bound by EU law. Washington wanted to detain the Grace 1 on the grounds that it had links to Iran's Islamic Revolutionary Guard Corps (IRGC), which it has designated a terrorist organization.

Greek authorities had no immediate comment on the situation.

Refinitiv ship tracking data showed early Monday the vessel was heading to Kalamata in Greece. (Marcos Moreno/The Associated Press)

Iran said on Monday any U.S. attempt to seize the tanker would have "heavy consequences."

Asked whether the United States could renew its seizure request after the tanker sailed from Gibraltar, Foreign Ministry spokesperson Abbas Mousavi said: "Such an action, and even the talk of it ... would endanger shipping safety in open seas."

"Iran has issued the necessary warnings through official channels, especially the Swiss embassy, to American officials not to commit such an error because it would have heavy consequences," Mousavi said in remarks broadcast on state television.

Switzerland represents U.S. interests in Iran, which has no diplomatic relations with the United States.

The initial impounding of the Grace 1, the vessel's former name, sparked a diplomatic row that escalated when Tehran seize a British-flagged oil tanker in the Gulf two weeks later. (Jon Nazca/Reuters)

Separately, a senior Iranian lawmaker said a crisis in Iran's ties with Britain, which included Tehran's seizure of a British-flagged tanker last month, would not be over until the tanker reached its destination.

Iran's Revolutionary Guards on July 19 seized the Stena Impero in the Strait of Hormuz waterway for alleged marine violations, two weeks after the Grace 1 was commandeered.

"Until the Iranian oil tanker arrives at its destination the British must help end the crisis," Heshmatollah Falahatpisheh, a member of parliament's national security and foreign affairs committee, was quoted as saying by the semi-official ISNA news agency.

"This means that the crisis with Britain is not over. Britain has the primary responsibility for ending the oil tanker crisis," Falahatpisheh said.

Mousavi said that Tehran was waiting for a court decision on alleged maritime violations by the Stena Impero and he hoped the procedures would be completed as soon as possible.

Iran has denied its tanker was ever headed to Syria, a close ally of Tehran.

The two vessels have since become pawns in a bigger game, feeding into wider hostilities since the United States last year pulled out of an international agreement to curb Iran's nuclear program and reimposed economic sanctions.