Brent crude futures jumped as much as 4 percent on Tuesday as strong stock markets helped the global oil benchmark recover substantially from a 6 percent tumble in the previous session.
U.S. crude prices closed down 11 cents, at $45.94 a barrel. Brent futures were up $1.90, or 2 percent, at $49.50 a barrel.
Stocks on Wall Street on Tuesday headed for a third straight day of gains in four, building on the euphoria in European equity markets after bullish second quarter euro zone growth and stellar German exports data.
Futures extended gains as U.S. stocks rose more than 1 percent.
Brent's gains were capped earlier by China's mixed crude imports for August. The data showed a 6 percent gain year-on-year and 10 percent rise for the first eight months, but a 13 percent slide from July.
Also weighing on the market was the growing potential for Iran to flood the oil market with more supply as the Obama Administration gained further support to block Congress' disapproval of its aim to lift nuclear-related sanctions on Tehran crude exports.
"There are random factors at play," said Scott Shelton, commodities specialist with brokerage ICAP in Durham, North Carolina.
U.S. crude was at $45.27 a barrel, down 78 cents since Friday's close. It had fallen almost $2 at one point.
U.S. markets were closed on Monday for the Labor Day holiday.
U.S. crude was weighed down by the closure of the largest crude distillation unit at ExxonMobil Corp's 502,500-barrels-per-day (bpd) Baton Rouge, Louisiana, refinery.
On Monday, Phillips 66 shut down a fluid catalytic cracker at its 314,000 barrel-per-day refinery in Wood River, Illinois. The gasoline-making unit is expected to restart within 48 hours, a source familiar with the plant's operations said.
In China, crude oil imports fell 13.4 percent in August to 6.29 million bpd from the previous month. But they rose 5.6 percent from a year earlier.
In the first eight months of 2015, China's crude imports were up 9.8 percent year-on-year at 6.63 million bpd, on still-solid demand for gasoline and kerosene as a growing middle class drives and flies more.
The dollar has also fallen against a basket of currencies since the end of last week, making oil less expensive for holders of other currencies.
Oil prices have fallen almost 60 percent since June 2014 on a global supply glut driven by near-record pumping from the Organization of the Petroleum Exporting Countries and from near-record levels of U.S. oil production.