Gold prices soared to an all-time high on Friday, breaching the $2,400-an-ounce mark for the first time as escalating tensions in the Middle East and concerns about China's economic recovery fueled robust demand for safe-haven assets. The precious metal's rally, which has been gaining momentum throughout the year, has also dragged silver prices higher, with both metals on track for their fourth consecutive weekly gain.

The latest surge in gold prices came amid growing fears of a potential Iranian missile attack on Israel or its allies, in retaliation for an Israeli strike on Iran's embassy compound in Syria. The United States and its allies believe that a major attack by Iran or its proxies is imminent, further stoking demand for the safe-haven metal.

"Gold prices are up again this morning, as more investors view it as a better hedge against geopolitical risk than government bonds due to US inflation concerns," wrote Mohamed A. El-Erian, the president of Queens' College in Cambridge and a Bloomberg Opinion columnist, in a post on X (formerly Twitter).

Central bank purchases, particularly from China, have also been a key driver of gold's impressive performance this year. Traders have been assessing the potential for rate cuts from the Federal Reserve over 2024, although strong US inflation data has clouded that outlook.

As of 1:09 p.m. in London, spot gold was trading 0.9% higher at $2,393.73 an ounce, with the metal on track for its fourth weekly advance, the longest such run since early 2023. Silver also rallied, reaching a high of $29.2295 an ounce, its highest level since February 2021. Both metals' 14-day relative-strength indexes are hovering near 80, well above the level that some investors consider overbought, potentially signaling a pause in the rally.

Ricardo Evangelista, senior analyst at ActivTrades, noted that there is potential for further upside in gold prices, as demand for safe-haven assets rises amid growing anxiety among investors about escalating geopolitical conflicts, according to REUTERS. "Concern about the Chinese economy feeds into worries about growth of the global economy and this also compounds the market sentiment of seeking safe-haven assets," he added.

China's March exports and imports data, which showed a contraction and highlighted the challenges faced by policymakers in bolstering the country's shaky economic recovery, have also contributed to the demand for gold.

Platinum and palladium also advanced, even as the Bloomberg Dollar Spot Index traded near its highest level since November. A stronger US currency typically acts as a headwind for commodities priced in the greenback, as it can dull interest from overseas buyers.

"Geopolitical risk is the fulcrum here," said Rhona O'Connell, head of market analysis at StoneX Financial Ltd. In a year with more than 50 local and national elections, ongoing tensions in the Middle East add "further fuel to the fire."

The strength in gold prices appears to have filtered through to support silver prices as well. Frank Watson, market analyst at Kinesis Money, wrote in a note that industrial production figures released on Tuesday gave a further signal on industrial demand for silver.