U.S. crude oil stocks rose for the first time since mid-May in the latest week as refinery utilization declined and imports increased, the U.S. Department of Energy said on Wednesday.
Gasoline inventories also increased, even as refinery production slowed, the Energy Information Administration said.
Gasoline futures, U.S. crude and Brent all swung to a loss after the bearish data was released.
Crude inventories rose by 1.7 million barrels in the week ended Friday, July 22, compared with analysts' expectations for a decrease of 2.3 million barrels, according to the EIA, the Energy Department's statistical arm.
Crude stocks at the Cushing, Oklahoma, delivery hub rose by 1.1 million barrels, EIA said. The move was the largest increase since early May.
"The report is bearish with the increase in crude oil and gasoline inventories, along with a merely modest decline in distillate," said John Kilduff, a partner at New York energy hedge fund Again Capital Management.
WTI crude futures for September delivery extended losses and were down 93 cents to $41.99 a barrel, a 2.2 percent loss at 10:51 Eastern. Brent crude futures for September delivery fell $1.19 to $43.68 a barrel, a 2.7 percent loss.
Gasoline stocks rose by 452,000 barrels, compared with analysts' expectations in a Reuters poll for a 40,000-barrel increase. The move came even as refinery crude runs fell.
Gulf Coast gasoline stocks rose to the highest level on record for July. East Coast gasoline stocks also rose to the highest level on record, beating the previous end-of-June record.
Refinery crude runs fell by 277,000 barrels per day, EIA data showed. Refinery utilization rates fell by 0.8 percentage point.
Distillate stockpiles, which include diesel and heating oil, fell by 780,000 barrels, versus expectations for a 714,000-barrel increase, the EIA data showed. U.S. Midwest distillate stockpiles fell to their lowest July level since 2013, while East Coast distillates fell by the most since the start of April.
U.S. crude imports rose last week by 224,000 barrels per day.
(Reporting By Jessica Resnick-Ault; Editing by Dan Grebler)