Brent crude rallied to $108 but pared gains, trading up 40 cents to near $107 a barrel. It was heading for its highest close since Dec. 31, and on track for its biggest daily gain in more than a month.
U.S. oil futures gained 62 cents to settle at $99.99 a barrel. The contract rose sharply as traders bought contracts to cover positions ahead of the expiration of the February contract.
Five Libyan officials, including the oil minister, announced they would resign, citing the prime minister's inability to "provide security...in the electricity and oil sectors." The announcement came after news earlier in the day that the prime minister intends to remove protesters who seized eastern ports vital to oil the country's oil exports.
Iran halted its most sensitive nuclear operations under a preliminary deal, raising prospects that the OPEC member will eventually increase oil exports, which curbed gains in Brent oil. A U.S. official said Iran was currently exporting about 60 percent less oil than it was two years ago and would be held to those reduced levels.