Crude prices ended the overnight session slightly higher after a volatile day in which the US benchmark passed $US75 a barrel for the first time in more than three years before turning negative and later recouping its losses.

Oil rallied early in Tuesday’s session on supply concerns, then slid as traders booked profits ahead of the July 4 holiday in the United States, and bet that global supply shortages would not persist as long as expected.

Crude pared its losses late in the session, turning positive on market sentiment that supply disruptions would not resolve faster than previously expected.

US light crude settled up 20 cents at $US74.14 a barrel, rebounding from a session low of $US72.73 a barrel.

In early trade, the contract rose to $US75.27, a 3-1/2-year high.

Brent crude was up 46 cents at $US77.76 a barrel, after trading as low as $US76.67 and as high as $US78.85.

The early gains came after Iran appeared to threaten to disrupt oil shipments from the Middle East Gulf if Washington pressed ahead with sanctions.

US crude rose above $US75 a barrel for the first time since 2014.

Prices retreated as some thought talk of supply disruptions might be overblown, said Gene McGillian, vice president of market research at Tradition Energy in Stamford, Connecticut.

He also said traders could be moving to liquidate bullish positions.

Pressure to liquidate may have accelerated ahead of the US holiday on Wednesday, said Tariq Zahir, managing member at Tyche Capital in New York.

Traders said supply disruptions could be short lived as OPEC and allied producers ramp up output.

The United Arab Emirates is ready to help alleviate possible oil shortages and OPEC will aim to adhere to the group’s ‘overall conformity levels,’ said UAE Energy Minister Suhail al-Mazrouei, who holds the OPEC presidency for 2018.

Traders also debated when production would restart at Syncrude Canada’s 360,000 barrels per day (bpd) oil sands facility near Fort McMurray, Alberta, hit by a power outage last month and likely to remain offline through July.

A quicker restart could boost supplies at the Cushing, Oklahoma, delivery hub for US crude.

Oil’s early gains came after the website quoted Iranian President Hassan Rouhani as dismissing Washington’s attempt to stop Iran’s oil exports.

While the comments were ambiguous, Iranian officials in the past have threatened to block the Strait of Hormuz, a major oil shipping route, in retaliation for any hostile US action.

Asked whether he intended to make a threat, Rouhani declined to provide a clarification.