Other commodities prices ended mixed. Metals prices were mostly higher, as were corn and soybeans. Copper and wheat futures fell.
Benchmark oil rose 94 cents to finish at $86.32 per barrel. That's a gain of just over 1 percent.
Airstrikes from Israel into Gaza killed a Hamas commander. Israeli leaders said the strikes were the start of a broad operation in response to days of heavy rocket fire from militants in the Palestinian territory.
In other energy trading, heating oil rose 2.74 cents to end at $2.9882 per gallon, gasoline futures rose 2.52 cents to end at $2.679 per gallon and natural gas rose 2.1 cents to end at $3.76 per 1,000 cubic feet.
Copper was the only major metal to fall. December gold rose $5.30 to $1,730.10 an ounce, December silver rose 39.3 cents to $32.88 an ounce, December palladium rose $4.95 to $641.55 an ounce and January platinum rose $5.20 to $1,591.60 an ounce.
High grade copper edged down 1.75 cents to $3.4535 a pound.
In agricultural contracts, December wheat slid 2.25 cents to $8.4875 a bushel, its fourth straight decline. December corn climbed 2.25 cents to $7.2575 a bushel and January soybeans rose 11 cents to $14.19 per bushel.