NEW YORK — Oil prices settled above $145 a barrel Monday, after swinging between gains and losses as traders weighed global supply concerns and a mixed dollar against worries about the health of the U.S. economy.

Light, sweet crude for August delivery settled up 10 cents at $145.18 a barrel on the New York Mercantile Exchange. Earlier, the contract dipped as low as $142.49 and rose as high as $146.37.

"There's a bit of a tug of war going on," said Addison Armstrong, director of market research at Tradition Energy in Stamford, Conn. "You've got some people in here trying to buy the dips a little bit ... but we're kind of stuck trading inside of Friday's range," when prices gyrated by nearly $6 and set a new trading high of $147.27.

Monday's swings came as the White House said President Bush plans to lift an executive ban on offshore oil drilling. Such a move will not ease tight global supplies in the short term, however, because a Congressional prohibition remains in place and any new wells would take months, if not years, to complete.

At the gas pump, prices hit a new U.S. record just a tenth of a penny shy of $4.11 a gallon, according to auto club AAA, the Oil Price Information Service and Wright Express. Retail diesel prices are also at an all-time high, of $4.824 a gallon.

The U.S. Federal Reserve said Sunday it was willing to lend to major U.S. government-backed mortgage giants Freddie Mac and Fannie Mae, which have seen their stock prices plummet amid subprime loan turmoil. The Treasury Department also said it would seek congressional approval to make a possible equity investment in the two companies.

"The Fed action on Fannie and Freddie is a short-term positive because it prevents a credit meltdown," said Victor Shum, an analyst with energy consulting firm Purvin & Gertz in Singapore. "But longer-term, it shows the extent of the problem facing the U.S. economy."

The dollar advanced marginally against the euro and yen, but fell against the pound and the Swiss franc. Investors have been buying dollar-denominated crude contracts as a hedge against inflation and a weakening dollar, pushing the price of oil to about double in the past year. When the dollar strengthens, such currency-related buying often unwinds.

"We believe that in light of the dollar reversal, energy bulls could find things rather difficult on the upside, at least during the early part of the week," Edward Meir, an analyst at MF Global, said in a research note.

Markets will be keeping a close eye on this week's testimony before Congress by U.S. Federal Reserve chairman Ben Bernanke, looking for signs, among other things, of which direction interest rates could take in the coming months.

"The stress in financial markets should be a dominant market-making influence this week," said Olivier Jakob at Petromatrix in Switzerland.

Geopolitical concerns continued to weigh on energy markets.

About 2,500 workers in Brazil's Campos Basin, which produces more than 80 percent of Brazil's oil output, began a strike Monday to demand that state-run oil company Petrobras give them an extra day off at the end of each two-week shift on the platforms.

"Supply-side concerns in Brazil, Iran and Nigeria are putting a high floor on prices," Shum said.

Iranian officials vowed on Sunday that the Islamic Republic would fight back against any attacks on it and "cut off the hands" of invaders. The comments came amid heightened speculation that Israel and the United States will attack Iranian targets to destroy what they say are Tehran's suspicious nuclear programs.

Iran is OPEC's second-largest oil exporter.

Supply concerns have helped keep energy prices high in recent days, although analysts said specific fears about cutbacks in Brazil and elsewhere were already factored into prices. Oil hit a trading record of $147.27 a barrel on Friday before closing just down from Thursday's settlement record.

"The (energy) complex will need fresher geopolitical headlines to keep the upside momentum intact," Meir said.

In other Nymex trade, heating oil futures fell a penny to $4.0666 a gallon while gasoline futures fell by a similar amount to $3.54 a gallon. Natural gas futures rose a penny to $11.970 per 1,000 cubic feet.

In London, August Brent crude was down 49 cents to $144 a barrel on the ICE Futures exchange.

Associated Press writers Alex Kennedy in Singapore and Pablo Gorondi in Budapest, Hungary, contributed to this report.