U.S. crude closed down slightly on Tuesday as investors fled to safe havens on worries about a near-bankrupt Greece and China's stock market losses and as technical selling threatened to push oil into a bear market.
Iran's determination to seal a nuclear deal with global powers to bring more of its crude to an oversupplied market and the restart of a key oil terminal in Libya also weighed on oil prices.
U.S. crude closed down 20 cents, at $52.33 a barrel, after falling almost $2 at the session low. Brent crude, on the other hand, rose 43 cents to $57 a barrel.
Investors fled to the relative safety of the dollar and U.S. bonds as Greek banks ran down to their last few days of cash after its people rejected international bailout while Chinese equities extended their hemorrhage, ignoring a slew of support measures from Beijing.
The dollar hit a five-week high, weakening demand for dollar-denominated commodities from users of other currencies.
"The U.S. dollar and Treasuries are what people are buying right now," said David Thomson, executive vice-president at Powerhouse, an energy-specialized commodities broker in Washington.