Gold prices surged to a record high on Wednesday, as conflicts in the Middle East and uncertainty surrounding the upcoming U.S. election spurred demand for safe-haven assets.

Spot gold traded at $2,749.82 per ounce as of 0437 GMT, after hitting an all-time high of $2,750.21 earlier in the session.

U.S. gold futures edged 0.2% higher to $2,764.00.

"Both presidential candidates are proposing inflationary policies, which will be very supportive for gold. While some of this is priced in, it will also provide ongoing support for higher prices," Michael Langford, chief investment officer at Scorpion Minerals, said.

Bullion is considered a hedge against economic and geopolitical uncertainties.

Democratic U.S. Vice President Kamala Harris held a marginal 46% to 43% lead over Republican former President Donald Trump, a new Reuters/Ipsos poll found.

In the Middle East, Israel confirmed it had killed Hashem Safieddine, the heir apparent to late Hezbollah leader Hassan Nasrallah who was killed last month.

Meanwhile, the U.S. Federal Reserve started its rate-easing cycle with a 50-basis-point cut last month. The odds of a similar move in November have faded entirely, but traders see a 92% chance of a quarter-basis-point cut, the CME FedWatch tool showed. Lower rates improve the appeal of non-yielding bullion.

"Gold has scaled new highs despite real and nominal yields edging higher, the dollar strengthening and U.S. equity markets scaling new highs," analysts at Standard Chartered said in a note.

"Gold's ability to latch on to coat tails that take prices higher irrespective of the macro backdrop suggests that the market continues to see positive underlying flows."

Spot silver fell 0.5% to $34.67 per ounce, after hitting its highest since late 2012 at $34.87 in the previous session.

"Silver's physical shortages provide strong support for the metal," Langford said.

Platinum rose 0.5% at $1,033.88 and palladium added 0.3% to $1,078.72.