Caught in a wild and gyrating market, crude oil prices briefly returned to triple-digit territory on Thursday, but gave up most of their gains to fall below $100 a barrel by the end of the day.

Crude oil futures settled at $97.88 a barrel, up 72 cents for the day, after jumping above $102 when trading opened on the New York Mercantile Exchange. The rise followed a 6.6 percent jump on Wednesday when panicky investors fled the stock market to seek shelter in the perceived safety of commodities.

After spending six months above $100, oil prices slumped earlier in the week because of concerns that the financial turmoil on Wall Street would slow economic growth and hurt oil demand. Prices fell to $91.51 a barrel on Tuesday, but since then they have made up some of their losses.

Image Petrochemical refineries in Texas City, Tex. The extent of damage to the industry in the wake of Hurricane Ike remained unclear. Credit... Pool photo by David J. Phillip

The worry in the markets now centers on efforts to restart production and refining operations on the Gulf Coast, the nation’s largest energy hub, which was battered by two powerful hurricanes in recent weeks. The disruptions forced oil companies to draw on their inventories, pushing stockpiles to their lowest levels in years.