Updated from 12:39 p.m. EST

Gold prices came close to smashing their record highs Thursday as funds piled into the metal as a safe-haven investment.

Benchmark contracts for bullion were ahead by $8.60 at $868.60 an ounce in recent action on the Comex division of the New York Mercantile Exchange, having retreated from a high of $872.90 earlier in the session.

Still, the move puts the price for the metal within reach of the $875 all-time high reached in January 1980 amid the Iranian hostage crisis. Spot prices have rallied from around $670 last summer driven by a slew of unfavorable news -- problems with dodgy home loans going bad, worrisome political developments in Pakistan, the rising cost of energy and a limp greenback.

"There's a lot of fund money coming early in the year," says Jon Nadler, a bullion analyst at the Montreal bullion dealer Kitco. In particular, he points to the malaise in Pakistan following the assassination of opposition leader Benazir Bhutto last week, as well as the latest rally in oil, as key factors spurring recent demand for gold.

Some investors buy gold as hedge against geopolitical uncertainly or to counteract the asset-withering effects of consumer price inflation, which can be stoked by rising energy prices.

The declining value of the U.S. currency also tends to buoy the value of dollar-denominated assets such as precious metals.

Despite the recent strength, Nadler adds that gold prices could see a significant pullback within the next few months.

"This type of price range isn't sustainable without seriously negatively impacting jewelry demand, or without increasing the supply of scrap jewelry," he says. Thus, increased supply and declining demand would tend to push prices lower.

As for the precious metals patch, UBS raised its rating on Gold Fields ( GFI) to buy from neutral, while RBC Capital Markets dinged shares of Silver Wheaton ( SLW) to an underperform from sector perform.

Shares of Silver Wheaton were recently dipping 2.6%, while Gold Fields was rising 2.6%.

Frank Barbera, editor of the Gold Stock Technician newsletter , suggests selling positions of major gold miners Newmont Mining ( NEM), Goldcorp ( GG) and Yamana Gold ( AUY) on the grounds that deterioration in the broader stock market will drag them down despite a buoyant gold price.

"We are very confident that the stock market has some really serious downside action ahead of it over the next few weeks and the first quarter," he recently wrote.

Elsewhere, among the miners, the Amex Gold Bugs Index, which tracks a basket of unhedged gold stocks, was rallying 1.1%, led higher by a 3.4% gain in Harmony Gold ( HMY).

Meanwhile, cash continued to pour into specialty precious metals funds during November, albeit at a slightly reduced rate. Mutual funds and exchange-traded funds took in net new cash investments of $666 million during the month, down from $957 million in October, according to new data from Boston-based Financial Research Corporation.

The Markets Vectors Gold Miners ( GDX) ETF led the pack, adding $201 million, up from $133 million in the previous month. The ETF holds a broad index of mining stocks.

Second in the pack was streetTracks Gold Shares ( GLD) which holds bars of gold bullion and saw an inflow of $125 million in November. That was down from $473 in October.

More from Stocks

Starbucks Just Revealed Some of the Most Worrying Data in Its History

Starbucks Just Revealed Some of the Most Worrying Data in Its History

Salesforce Is Hitting on All Cylinders as Shares Notch an All-Time High

Salesforce Is Hitting on All Cylinders as Shares Notch an All-Time High

Trump's Tariff Attack Hasn't Brought Pain to These Hot Stocks

Trump's Tariff Attack Hasn't Brought Pain to These Hot Stocks

Why GE's Stock Has Fallen 15% in the Last 30 Days

Why GE's Stock Has Fallen 15% in the Last 30 Days

Banks Prepare to Up Shareholder Payouts By $30 Billion

Banks Prepare to Up Shareholder Payouts By $30 Billion