By Nicole Friedman 

U.S. oil prices fell to a near-three-month low Tuesday on concerns about a growing glut of crude oil and turmoil in the Chinese stock market.

Light, sweet crude for August delivery fell 20 cents, or 0.4%, to $52.33 a barrel on the New York Mercantile Exchange, the lowest settlement since April 13.

Brent, the global benchmark, rose 31 cents, or 0.5%, to $56.85 a barrel on ICE Futures Europe, after falling as low as $55.10 a barrel earlier in the session.

On Monday, oil prices posted their largest declines since February on concerns about a continued oversupply of crude. Output from the U.S. and the Organization of the Petroleum Exporting Countries has increased in recent months, surprising some investors who had expected production to decline as low oil prices prompted producers to slash spending on new production. Though demand has risen sharply, some market watchers say that consumption won't be enough to eat away at the global glut of crude oil until 2016.

The U.S. Energy Information Administration said Tuesday that U.S. production fell from a 44-year high in May and is expected to keep declining through February 2016. Even so, the agency expects global supplies to exceed consumption this year and next.

Recent data showing higher-than-expected oil supplies, along with concerns about the crisis in Greece and the stability of China's stock market, have prompted some traders to pull back from bullish bets on oil. Money managers, including hedge funds, cut their aggregate bet on rising oil prices in the week ended June 30 to the smallest since April, according to the Commodity Futures Trading Commission.

"It's been three days of can't-catch-your-breath," said Michael Hiley, an energy trader at brokerage LPS Partners Inc., adding that traders got caught off-guard and had to close out positions once prices broke out of the narrow band they had traded in for several weeks.

"We were sort of stuck in a range for two months and then it's gone," Mr. Hiley said. "It's hard to pick a bottom here."

Prices traded near flat, hovering around $60 a barrel, in May and June as traders weighed expectations of slowing U.S. production against concerns that higher prices would prompt producers to ramp up their drilling activity.

"People had already bought this market, they had ridden it up, and the question is, what do they do next?" said John Saucer, vice president of research and analysis at Mobius Risk Group. "Anybody that bought any crude during that multi-month range is certainly now underwater, if they're still in the position."

Gyrations in the Chinese stock market have weighed on a variety of commodities, including copper and iron ore, which rely on Chinese consumption. Chinese stock indexes are down more than 25% from highs reached in June. China is the No. 2 consumer of crude oil.

"The incremental buying that has kept the oil market in a pretty solid condition has been Chinese buying," said Scott Shelton, broker at ICAP PLC. "I don't think that we're selling off because of oil. I think we're selling off because oil's a part of an asset class that will suffer should the Chinese stock market continue to melt down."

Talks between Iran and six world powers were extended past Tuesday night's deadline to July 10. Many market participants expect a final deal with Iran over its nuclear program to be reached, which would likely weigh on oil prices. A deal would lead to the lifting of sanctions on Iran's oil exports, allowing the country to sell more crude into an already-oversupplied global market.

Traders are also waiting on weekly inventory data due from the EIA on Wednesday. Crude-oil inventories unexpectedly rose last week for the first time in nine weeks, weighing on prices. Analysts surveyed by The Wall Street Journal expect Wednesday's report to show that stockpiles fell by a million barrels in the week ended July 3, while gasoline inventories were unchanged and stocks of distillates, including heating oil and diesel fuel, rose.

The American Petroleum Institute, an industry group, said late Tuesday that its own data for the same week showed a 950,000-barrel draw in crude-oil supplies, according to sources. The group said that gasoline supplies fell by 2 million barrels, according to the sources. API said U.S. distillate stocks were up by 4.2 million barrels in the week, according to the sources.

Gasoline futures rose 2.57 cents, or 1.3%, to $1.9494 a gallon. Diesel futures gained 0.24 cent, or 0.1%, to $1.7113 a gallon.

Write to Nicole Friedman at nicole.friedman@wsj.com