Oil rose past $97 a barrel before pulling back to just below that mark Thursday, as U.S. crude stocks fell and geopolitical tension mounted after the killing of Pakistani opposition leader Benazir Bhutto.
US light, sweet crude gained $1.40 to $97.37 a barrel by early afternoon but later retreated from that level. London Brent crude also rose.
U.S. government data showed crude oil inventories off 3.3 million barrels in the week to Dec. 21 to the lowest level since January 2005. Analysts had expected only a 1 million barrel draw.
Stocks of distillates including heating oil fell by 2.8 million barrels, according to the U.S. Energy Information Administration.
"Virtually all aspects of EIA report look bullish, and when combined with ... (the) Pakistan geopolitical risk premium, a run at record highs appears likely by the week's end," said Jim Ritterbusch, president of Ritterbusch & Associates.
Bhutto was assassinated as she left an election rally in the city of Rawalpindi, putting Jan. 8 polls in doubt and sparking anger in her native Sindh province.
"Pakistan is a crucial country in the region and prospects for political uncertainty are leading to some nervousness (which is reflected in) gold, bond and oil prices rising and the dollar dipping," said Audrey Childe-Freeman, European economist at CIBC bank in London.
Oil hit a record $99.29 a barrel on Nov. 21 on concerns about consumer nation supplies ahead of winter and the U.S. dollar's decline against other currencies, which supported commodities denominated in the greenback.
Worries about the impact of the credit crisis on oil demand growth in top consumer the United States then dragged prices down from record peaks.
Turkey's raid on Kurdish guerrilla targets in northern Iraq sent oil to one-month highs on Wednesday.
Turkey's dispute with the Kurdish separatists poses little immediate threat to Iraq's main oil exports via its southern terminals, but the instability adds an element of risk to regional flows, analysts said.