Gold prices hovered near record highs on Wednesday, steered by expectations of a Federal Reserve rate cut and persistent Middle East tensions, while the spotlight shifted to U.S. inflation data.

Spot gold was up 0.4% to $2,474.04 per ounce by 1051 GMT, shy of the record high of $2,483.60 scaled last month.

U.S. gold futures rose 0.2% to $2,513.20. U.S. producer prices increased less than expected in July, data showed on Tuesday, ahead of U.S. consumer price index data due later at 1230 GMT. Economists expect consumer prices to have risen 0.2% month-on-month in July, with year-on-year core inflation seen slowing slightly to 3.2%.

If the data confirms the slowdown in U.S. price growth, bets of a 50 bp rate cut in September will increase and it is very possible that the price of gold will reach an all-time high, said Ricardo Evangelista, senior analyst at ActivTrades.

Markets currently see a 55.5% chance of 50 basis point U.S. rate cut in September, according to the CME FedWatch Tool.

Bullion is traditionally considered a hedge against geopolitical and economic risks, and lower interest rates reduce the opportunity cost of holding the asset.

"I think that economic indicators will continue to drive Western investors towards the asset of gold," said World Gold Council market strategist Joseph Cavatoni.

In the Middle East, Iran has vowed a severe response to the killing of the leader of Hamas late last month. Israel has neither confirmed or denied its involvement.

Concerns about the fallout of a potential Iranian strike on Israel is playing into investors’ minds and feeding demand for safe-haven gold, Evangelista added.

Spot silver gained 0.3% to $27.92 and platinum rose 0.7% to $942.65. Palladium gained 0.5% at $943.58.

(Reporting by Ashitha Shivaprasad and Anushree Mukherjee in Bengaluru; Editing by David Evans and Ana Nicolaci da Costa)