Gold held just below a record high on Thursday, heading for its best month in seven, as a hotly-contested U.S. presidential election sparked safe-haven demand, while investors await the release of a key U.S. inflation print.

Spot gold was down 0.3% at $2,778.47 per ounce by 1124 GMT, after hitting a record high of $2,790.15 earlier in the session. Prices have firmed nearly 6% for the month so far.

U.S. gold futures dipped 0.4% to $2,789.40.

Opinion polls are too close to call a winner between Republican former U.S. President Donald Trump and Democratic Vice President Kamala Harris in the highly anticipated final phase of the U.S. election.

Underlying forces spurring demand for gold include geopolitical tensions and uncertainties about the outcome of the election, with the market remaining in a "buy-on-dips" mode, said StoneX analyst Rhona O'Connell.

"Gold and the (U.S.) dollar are acting together as safe-havens, which is not unusual in times of strife."

Investors are now awaiting U.S. core personal consumption expenditures (PCE) and weekly jobless claims data, due at 1230 GMT, while the payrolls report is on Friday.

Traders see a 96% chance of a quarter-basis-point rate U.S. rate cut next week.

Meanwhile, UBS expects a target of $2,900/oz for gold by the end of the third quarter in 2025.

"A Trump win could push gold more quickly toward our target, while a Harris win could see it drop back to $2,600-2,700/oz."

Expectations of a Trump victory have driven the rally in gold, given his views on trade tariffs, higher government spending, lower taxes, and lower interest rates, UBS said.

Gold is considered a safe investment during economic and geopolitical turmoil and thrives in a lower interest rate environment.

On Thursday, spot silver fell 0.9% to $33.49 per ounce. It is up more than 7% for the month.

Platinum shed 0.5% to $1,003.90. Palladium was down 2.1% at $1,123.29, headed for its best month since January 2022.

(Reporting by Anushree Mukherjee in Bengaluru; Editing by Sonia Cheema)