Capping a relentless rise in recent years, oil prices hit a record high during the day on Monday, then pulled back to close below the record.

The day’s highest trading price, $103.95 a barrel on the New York Mercantile Exchange, broke the record set in April 1980 during the second oil shock. That price, $39.50 a barrel, equals $103.76 today, when adjusted for inflation.

The surge in energy prices is taking place as investors seek refuge in commodities to offset a slowing economy and a declining dollar. Analysts pointed out that financial institutions like pension funds and hedge funds are also buying oil and other commodities like gold as hedges against a rise in inflation.

That trend is expected to continue, especially after Ben S. Bernanke, the chairman of the Federal Reserve, signaled last week that he was ready to cut interest rates further to bolster economic growth, despite rising consumer prices.