Flames emerge from a pipeline at the oil fields in Basra, southeast of Baghdad, Iraq, October 14, 2016.

Oil prices hit nearly six month highs on Tuesday, continuing to rally after U.S. President Donald Trump surprised the market with strict new measures aimed at driving Iran's crude exports to zero.

The Trump administration announced on Monday that it will not extend sanctions waivers to a handful of countries that import Iranian oil. The decision means any entity caught purchasing Iran's barrels after May 1 risks triggering U.S. sanctions, which are designed to deprive the Iranian leadership of oil revenue.

U.S. West Texas Intermediate crude settled 75 cents higher at $66.30 a barrel, rising 1.1% and setting a new closing high going back to Oct. 29. WTI earlier rose as high as $66.60 on Tuesday, its best intraday price since Oct. 31.

Brent crude futures were up 53 cents at $74.57 per barrel around 2:30 p.m. ET. The international benchmark for oil prices earlier rose to $74.73, its highest since Nov. 1.

Brent surged 3 percent and WTI popped 2.7 percent during the previous session, driven by the change in U.S. policy towards Iran.

"The decision to completely eliminate waivers was a surprise, as the market expectation was for a more gradual reduction," Credit Suisse said in a research note.

The administration issued waivers to eight countries when it restored sanctions on Iran's energy industry in November, allowing them to purchase limited quantities of Iranian crude. Five of the countries — China, India, Turkey, South Korea and Japan — took advantage of the exemptions.

The waivers allowed 1.4 million barrels per day of Iranian crude to flow to the market, down from about 2.5 million bpd last year. The new U.S. policy threatens to wipe out much of that supply at a time when the oil market is already tightening, though analysts expect some countries to defy Trump's ultimatum.

Credit Suisse thinks Iran's exports will not fall to zero, but could drop by another 600,000 bpd. The investment bank estimates the global oil market is already undersupplied by about 300,000 barrels per day.

The Trump administration says Saudi Arabia, the United Arab Emirates and other allies have agreed to fill any gap left by the loss of Iranian exports.

Saudi Arabia will "coordinate with fellow oil producers to ensure adequate supplies are available to consumers while ensuring the global oil market does not go out of balance," said Khalid al-Falih, the kingdom's influential energy minister.

OPEC and Russia, together with several other nations, are currently trying to keep 1.2 million bpd off the market.