U.S. light crude ended Wednesday's session up 98 cents, or 1.4 percent, at $69.51 a barrel, having touched a three-week high earlier in the session.
Benchmark Brent crude oil rose $1.18, or 1.6 percent, to $77.13 a barrel by 2:25 p.m. ET, after rising to its highest level since July 11.
U.S. crude inventories fell 2.6 million barrels last week, the Energy Information Administration said, exceeding the 686,000-barrel draw forecast by analysts polled by Reuters.
Gasoline stocks fell by 1.6 million barrels, compared with analysts' expectations in a Reuters poll for a 370,000-barrel gain. Distillate stockpiles, which include diesel and heating oil, fell by 837,000 barrels, versus expectations for a 1.6 million-barrel increase, the EIA data showed.
Increased gasoline demand was particularly supportive to the market given that crack spreads had been weak, said Bob Yawger, director of energy futures at Mizuho.
Oil prices were also buoyed by renewed focus on Iran, as exports there "are falling faster than previously expected," Jim Ritterbusch, president of Ritterbusch and Associates, said in a note.
Iran's crude oil and condensate exports in August are set to drop below 70 million barrels for the first time since April 2017, preliminary trade flows data on Thomson Reuters Eikon show.
Many crude buyers have already reduced orders from Iran, OPEC's third-biggest producer, ahead of the Nov. 4 start date for U.S. sanctions.
Although Tehran is offering steep discounts, Iran's August loadings are estimated at 2.06 million barrels per day (bpd) versus a peak of 3.09 million bpd in April.
In Venezuela, where production has halved since 2016, the state-run oil firm PDVSA said on Tuesday it had signed a $430 million investment agreement to increase production by 640,000 bpd, although some analysts doubted whether this investment would go through given ongoing instability.
Meanwhile, the preliminary export plan for fellow OPEC member Angola indicates that its shipments have dropped to the lowest level since December 2006, as a lack of investment in aging infrastructure continues to limit production.
Despite the risk of disruption from these OPEC producers, Bank of America Merrill Lynch said global supply could climb toward the end of the year, in part due to increased non-OPEC output from Canada, the U.S. and Brazil.
Norway's Equinor said it plans to develop new oil fields in Brazil and raise output from 90,000 barrels of oil equivalent per day to between 300,000 and 500,000 boepd by 2030.
— CNBC's Tom DiChristopher contributed to this report.