Oil for January delivery rose $1.05 to finish at $86.92 a barrel on the New York Mercantile Exchange. That's an increase of 1.2 percent.
Air raid sirens sounded in Jerusalem after the militant group Hamas aimed rockets at the city from the Gaza Strip. Israel called up 16,000 reservists, moving a step closer to a ground campaign. Investors worried that a worsening of the conflict could impact the flow of oil from the region.
In other energy trading, heating oil rose 1.33 cents to finish at $2.9868 per gallon, wholesale gasoline rose 1.39 cents to end at $2.7101 per gallon and natural gas rose 8.3 cents to finish at $3.9040 per 1,000 cubic feet.
Gold for December delivery rose 90 cents to finish at $1,714.70 an ounce.
In other metals trading, December silver fell 30.4 cents to end at $32.37 an ounce, December copper fell 1.1 cent to $3.4515 a pound, January platinum dropped $11.50 to $1,561.80 an ounce and December palladium fell $4.75 to $626.45 an ounce.
In agricultural contracts, December wheat fell 7.5 cents to end at $8.38 a bushel, December corn rose 5.75 cents to $7.27 a bushel and January soybeans fell 18.75 cents to end at $13.8325 per bushel.