The U.S. Energy Information Administration said inventories rose by 100,000 barrels in the week to 362.4 million barrels.
Traders had expected a gain of about 1.1 million barrels.
On the New York Mercantile Exchange, crude oil gained 45 cents to reach $102.51 per barrel.
Natural gas gave up 14 cents to settle at $4.86 per million British thermal units.
Reformulated blendstock gasoline prices dropped 0.26 cents to end at $2.7955 per gallon.
Heating oil prices finished the day at $3.1261 per gallon, up 1.71 cents.
At the pump, the national average price for a gallon of unleaded rose from Tuesday's $3.426 per gallon to $3.432, the AAA Daily Fuel Gauge Report said.