Oil prices rose about 1%, with global benchmark Brent settling at a two-week high in volatile trade on Tuesday as traders worried about tight supplies and a weaker dollar.
Brent futures rose $1.08, or 1.0%, to settle at $107.35 a barrel. US West Texas Intermediate (WTI) crude rose $1.62, or 1.6%, to settle at $104.22.
Brent posted its highest close since July 4 and WTI its highest since July 8. At one point during the volatile session, both benchmarks were down around $2 a barrel.
"Crude oil has staged an incredible turnaround today," said Robert Yawger, executive director of energy futures at Mizuho.
"There was no big red bullish headline to greenlight the rally, but the combination of beaten down open interest and low trade volume will often encourage wild price swings," Yawger said.
The US dollar slid to a two-week low against a basket of other currencies, making oil less expensive for buyers using other currencies.
Oil prices have whipsawed, supported by supply fears due to Western sanctions on Russia, but pressured by global central bank efforts to tame inflation which stoked fears that a potential recession could cut energy demand.
On Friday, open interest in New York Mercantile Exchange futures fell to the lowest since September 2015 as investors cut risky assets like commodities, worried that the Federal Reserve will keep raising US interest rates.
The US-Canada Keystone pipeline was operating at reduced capacity on Monday after a pump station was shut.
Libya's new National Oil Corp (NOC) chief Farhat Bengdara rejected challenges to his appointment and work resumed at some shuttered fields and ports.
The US 3:2:1 and gasoline crack spreads - measures of refining profit margins - both fell to their lowest since April.
"Crack spreads continuing plunge of past four weeks to narrowest level since late April ... suggesting weakening product demand," said analysts at Ritterbusch and Associates, a consultancy.
Last week, US President Joe Biden visited top oil exporter Saudi Arabia, de facto leader of the Organization of the Petroleum Exporting Countries (OPEC), whose crude exports slipped in May to a four-month low.
Biden hoped to strike a deal on an oil production boost to tame fuel prices, but the kingdom's foreign minister said the market's problem was not a crude shortage but a lack of refining capacity.
In the United States, expectations for an increase in crude inventories weighed on prices. Analysts polled by Reuters forecast crude inventories rose by 1.4 million barrels last week. ,
The American Petroleum Institute (API), an industry group, will issue its inventory report at 4:30 p.m. EDT (2030 GMT) on Tuesday. The US Energy Information Administration (EIA) reports at 10:30 a.m. EDT (1430 GMT) on Wednesday.
On Tuesday, people familiar with Biden's plans told Reuters that the president plans to announce new federal measures aimed at the climate crisis on Wednesday.
Early in the session, oil prices fell on weak economic data from around the world.