Crude supplies fell 3.5 million barrels to 333.6 million barrels last week, the U.S. Energy Department reported in its weekly report on U.S. petroleum stockpiles.
Gasoline supplies declined 3.6 million barrels to 192.6 million, the department said. Supplies are 8.2 percent below year-ago levels.
Wall Street economists expected a drop of about half what the department reported.
Light, sweet crude for October delivery rose $1.78, or 2.48 percent, to close at $73.51 a barrel on the New York Mercantile Exchange.
The last time the contract closed this high was Aug. 3.
September natural gas fell 16.3 cents, or 2.91 percent, at $5.43 per 1,000 cubic feet. The contract expired at the end of the session.
October natural gas, which became the front-month contract, closed down 18 cents, or 3.1 percent, at $5.581 per 1,000 cubic feet.
Heating oil added 4.56 cents, or 2.28 percent, at $2.0419 a gallon.
Reformulated-gasoline blendstock for oxygen blending advanced 9.03 cents, or 4.48 percent, to $2.1057 a gallon.
AAA said the average U.S. retail regular unleaded gasoline price was $2.758 a gallon, up 1.3 cents from Tuesday's $2.745 a gallon.