The U.S. government's Energy Information Administration (EIA) said crude stockpiles rose 2.1 million barrels last week, to a peak of 504.1 million barrels in the third week of hitting record highs in past month. [EIA/S]

The EIA also cited record high gasoline inventories and higher stocks of distillates that include heating oil and diesel.

Brent , the global benchmark for crude, settled down 22 cents at $34.28 a barrel, having risen more than $1.20 before the data. It had gained a total of more than $4 between Friday and Wednesday.

U.S. crude settled up by a modest 11 cents at $30.77 a barrel, after an earlier peak at $31.98. Reuters data showed the daily volume in U.S. crude futures at just over 200 million barrels, down 75 percent from two weeks ago.

Oil prices had risen more than 14 percent over the last three days after a plan by Saudi Arabia and Russia, endorsed without commitment by Iran on Wednesday, to freeze oil output at January's highs.

Thursday's EIA data, if followed through by more builds in U.S. crude, could undermine oil producers' hopes for continued price recovery, traders and analysts said.

"We should see crude sell off in the days to come," said Tariq Zahir, oil trader and fund manager at Tyche Capital Advisors in Long Island, New York.

"We're still in a very well-supplied market and with refinery maintenance coming up and warmer weather heading to the U.S. East Coast, we are likely to see substantial builds in the weeks to come."

The Saudi-Russian production freeze plan, also joined by Qatar and Venezuela, is the first such deal in 15 years between the Organization of the Petroleum Exporting Countries and non-OPEC members.

But following Iran's failure to commit to a production freeze, Iraq's oil minister on Thursday signalled Iraq would wait for more cooperation between producers before committing to freeze its own production.

Iran is the major obstacle to the deal, having pledged to increase output sharply to regain market share lost during sanctions, which were lifted last month after an agreement with world powers, allowing Tehran to resume selling oil freely in international markets.

While oil producers hope their efforts will end the 20-month long selloff that brought crude down from above $100 a barrel in mid-2014, the only certainty ahead could be choppier markets.

"What we see still is extreme volatility," said Carsten Fritsch, analyst at Commerzbank. "I would not be surprised to see prices retreating again by a big margin in coming days."

(Additional reporting by Alex Lawler in London; Editing by Adrian Croft, Chris Reese and Marguerita Choy)

By Barani Krishnan