SAN FRANCISCO (MarketWatch) -- Gold futures rose more than $6 an ounce Thursday, to close at their highest level in five weeks, as the dollar touched new lows against the euro and the British pound and as oil prices remained high.

These factors combined to underpin investment demand for the precious metal.

Gold for August delivery gained $6.20, or 0.9%, to close at $668.30 an ounce on the New York Mercantile Exchange. The contract tapped $671 earlier, a level not seen since June 7, after falling $2.30 an ounce on Wednesday, thus ending a three-session winning streak. Read more.

"The breakdown of the dollar is bringing investors into the market," said Julian Phillips, an analyst at GoldForecaster.com.

"Both the gold price and the dollar breaking down through long-term support is bringing professionals to adjust their positions as well as short-term traders to take advantage of the break through $665," he said in e-mailed comments.

Overall, the "change in the market mood after such a long consolidation is more than noticeable. We expect a lively market going forward," he said.

On the currency market, the dollar fell to a new record low against the euro and a 26-year trough against sterling on Thursday, continuing its recent slide on fears over the U.S. subprime-mortgage market and potential economic weakness.

The euro was last up 0.3% at $1.378, after touching an intraday high at $1.3797. The British pound rose to $2.0365, before easing slightly to trade at $2.0295. See Currencies.

"Investors remained concerned at the vulnerability of the U.S. dollar here," said Peter Spina, an analyst at GoldSeek.com.

"From a technical perspective, the Dollar Index is teetering at massive support," he said. "Should there be a failure of support, the selling is likely to accelerate and investors will flock to precious metals."

Besides the weakness in the greenback, high crude prices helped boost sentiment on the gold market. Crude oil for August delivery climbed as high as $73.80 a barrel Thursday, then retreated to touch a low of $72 as traders weighed developments linked to supplies. See Futures Movers.

Economic data released in the U.S. did little to move the gold market. "It was a yawn on that one," said Jon Nadler, analyst at Kitco Bullion Dealers.

The nation's trade deficit reached $60 billion in May, on record trade flows across U.S. borders to meet rising demand at home and abroad, the Commerce Department reported. The widening of the trade gap was exactly as expected by economists surveyed by MarketWatch. See full story.

Meanwhile, first-time claims for state unemployment benefits fell last week to their lowest level since the middle of May, falling 12,000 in the week ended July 7 to stand at 308,000, the Labor Department said. See full story.

"The trade gap came in about as expected," said Nadler in e-mailed comments. "The employment data look decent too."

Nadler also cited the latest rally in Wall Street stocks: "It seems the equity sector sees great things down the road into next year." See Market Snapshot.

Other metals prices also gained, although September copper lost 4.05 cents, or 1.1%, to finish at $3.581 a pound, giving back Wednesday's gain of more than a penny.

September silver rose by 20.5 cents to end at $13.18 an ounce, September palladium added $1.30 to close at $372.75 an ounce and October platinum gained $14.60 to close at $1,330.70 an ounce.

Inventories and indexes

Gold warehouse inventories fell by 32,056 troy ounces to stand at 7.13 million troy ounces as of late Wednesday, according to Nymex data. Silver supplies rose to 135.2 million troy ounces, up 1.2 million troy ounces, while copper supplies dropped 112 short tons to 21,877 short tons.

In the big metals-sector news Thursday, Rio Tinto RTP (RIO) reached agreement to buy Canadian aluminum producer Alcan AL, -1.94% (AL) for $38.1 billion in cash, topping a hostile offer from Alcoa AA, -4.65% by roughly a third. Read more.

Meanwhile, indexes tracking stocks in the metals sector reflected the strength in the broader stock market, sending the Philadelphia Gold and Silver Index XAU, +1.17% to a peak of 150.90, its highest level since September of last year. The index closed at 150.79, up 3.3%.

The CBOE Gold Index GOX rose 3.3% to close at 155.58 points, while the Amex Gold Bugs Index HUI, closed up 1.1% at 357.06 points.

As for sector exchange-traded funds, the StreetTracks Gold Trust ETF GLD, +0.84% rose 0.9% to end at $66.05. The iShares Silver Trust ETF SLV, +2.18% gained 1.2% to close at $130.03 and the Market Vectors-Gold Miners ETF GDX, +1.28% reached $41.29, closing up 1.6%.

"Fund inflows have been very strong as demonstrated by the gold ETF," Spina.

But "it remains to be seen if the current pressures on gold will subside from here and keep gold in a summer trading range or if we see a breakout right now," he said. "One way or another, gold is looking quite attractive once again from an investment perspective and should keep a strong floor underneath the current price."