New York's main contract West Texas Intermediate light sweet crude for February delivery, finished at $99.65 a barrel, an increase of 29 cents from Wednesday's close.
In London, Brent North Sea crude for February gained 45 cents to settle at $108.01 a barrel.
The WTI price took a hit after the government reported an unexpected increase in US crude oil stockpiles, by 3.9 million barrels, last week, reflecting weaker demand in the world's biggest oil-consuming nation.
Distillates also rose unexpectedly, by 1.2 million barrels. These stockpiles, which include heating fuel, are closely watched by the market at the beginning of winter.
Also tempering demand was a feeble Italian debt auction that helped push the euro to a 16-month low against the dollar. That makes dollar-priced crude less attractive to buyers using euros.
But oil prices rebounded into positive territory in late trade.
"The market is extremely lightly traded so it does not take a lot" to produce sharp price movements, said Tom Bentz at BNP Paribas.
"After getting down towards the $98 area the market got quiet, and we got a recovery," Bentz said.
"The reality is that there is a lot of stuff going on in the Middle East and that the market is nervous about it."
A showdown between Iran and the United States over Tehran's threats to close the strategic Strait of Hormuz to oil tankers worsened Thursday.
Iran's Revolutionary Guards rejected a warning that the US military would "not tolerate" such a closure, saying they would act decisively "to protect our vital interests."
More than a third of the world's tanker-borne oil passes through the Strait of Hormuz, a choke point linking the Gulf's petroleum-exporting states to the Arabian Sea and beyond.
Also helping prices were better-than-expected reports on pending sales of US homes and manufacturing activity in the Chicago region, and a weekly jobless claims reading that confirmed the broader trend of improvement in the depressed labor market.
What the stars mean:
★ Poor ★ ★ Promising ★★★ Good ★★★★ Very good ★★★★★ Exceptional