Bars of gold are seen at the Krastsvetmet company, one of the world's largest producers of precious metals in Moscow, Russia on January 31, 2023. 

Gold gave up some gains on Friday and was on course for a third straight weekly loss on the likelihood of a last-minute debt ceiling deal and as a hotter-than-expected U.S. inflation gauge raised bets for rates to stay higher for longer.

Spot gold was up 0.35% at $1,947.09 per ounce, having risen as much as 0.9% earlier. U.S. gold futures settled mostly flat at $1,944.30.

The White House and congressional Republicans aim to put the final touches on a deal to raise the debt ceiling for two years.

Gold hit a two-month low of $1,936.59 during Asian trading hours, and is set to lose 1.7% for the week.

"Despite positive noises coming from D.C., a debt deal may still be difficult to get through before June 1," said Tai Wong, a New York-based independent metals trader.

But short-term players expect a deal to be done and "have been selling behind inflation data that suggests a June hike is possible," Wong added.

The personal consumption expenditures (PCE) price index, which the Federal Reserve tracks for its 2% inflation target, increased 4.4% in the 12 months through April after advancing 4.2% in March.

"The PCE number just kicked one of the legs out on the stool of the gold market ... a softer number would have provided the tailwind behind gold," said Phillip Streible, chief market strategist at Blue Line Futures in Chicago.

Traders are now betting the Fed will deliver an 11th straight rate hike in June, which would erode the attraction of zero-interest-bearing gold.

Benchmark 10-year Treasury yields and the dollar index hovered near their highest levels since mid-March, both on track for their third straight weekly gains