The West Texas Intermediate for September delivery rose 1.06 U.S. dollars to settle at 42.67 dollars a barrel on the New York Mercantile Exchange. The settlement marked the highest for a front-month contract since March 5, according to Dow Jones Market Data.
Meanwhile, Brent crude for October delivery climbed 93 cents to close at 45.43 dollars a barrel on the London ICE Futures Exchange.
U.S. crude oil inventories decreased by 4.5 million barrels during the week ending Aug. 7, the U.S. Energy Information Administration said in a report on Wednesday. The reading followed sizable drops in each of the previous two weeks. Analysts polled by Reuters had expected a 2.9 million barrel decline.
Wednesday's gains followed a downbeat session on the energy market.
Fluctuating sentiment continued, Eugen Weinberg, energy analyst at Commerzbank Research, said in a note on Wednesday, adding "the fundamental situation on the oil market remains price-supportive for the time being."