Gold prices ended higher Thursday, to recoup a portion of the losses of the past three sessions, but a snapshot of consumer-level inflation came in hotter than expected, limiting the precious metal’s rise.

“After a series of subdued readings, even with today’s pick up, inflation is still well below the 2% target,” said Adrienne Murphy, chief market analyst at AvaTrade. “This key economic factor will obstruct the [U.S. Federal Reserve’s] plans to hike rates.”

Data Thursday showed the consumer-price index rose 0.4% in August for the biggest rise since January. The rise lifted the yearly increase in inflation to 1.9% from 1.7%.

The ICE U.S. Dollar Index DXY, +0.05% remained lower after the report, on track to end a three-session climb—likely helping gold, which is primarily priced in the U.S. unit.

Gold futures extended their modest decline initially after the report, then climbed. Gold for December delivery US:GCZ7 tacked on $1.30, or 0.1%, to settle at $1,329.30 an ounce. On Wednesday, the futures settled at $1,328—the lowest since Aug. 31, according to FactSet. The SPDR Gold Shares ETF GLD, +0.13% was trading 0.6% higher.

Read:Gold bulls are looking for a ‘major breakout’ above $1,400 an ounce

The Fed raised interest rates twice this year in response to steady growth and falling unemployment, but mostly soft inflation data have tempered market expectations for another hike before the year. Higher rates also boost the dollar, in which gold is priced.

The Fed has been concerned with the weak readings, raising some doubts that the central bank will hike rates again this year. However, if inflation starts to pick up again in coming months, expectations for a December rate increase are likely to be rekindled, as select Fed members have insisted they want policy to be a step ahead of inflation.

“While interest rates in the U.S. remain so low, equity markets will continue to overheat while gold’s gains will continue to be capped,” said Murphy. “The Fed are notoriously optimistic with its inflation expectations, so investors could be surprised with how slow the body actually raises the cost of borrowing which is good news for gold.”

The S&P 500 SPX, -1.11% looked to be in a holding pattern after scoring its latest record highs. Stock weakness could limit the downside for safe-haven gold.

The retreat in gold so far this week followed its finish Friday at its highest since Sept. 6, 2016, chiefly driven by concerns that North Korea was preparing to conduct another missile test. In comments Thursday, made after tighter United Nations sanctions, the reclusive regime said it would reduce the U.S. to “ashes and darkness.”

Haven demand should continue to underpin precious metals, said analysts at Capital Economics, in a note.

“The latest leg-up in the net-long position in gold futures does not appear to have been driven by a revision of expectations of Fed tightening,” said Caroline Bain, chief commodities economist at Capital Economics. “Instead, we think that the surge in net longs and the inflows into gold ETFs reflect safe-haven demand on the back of an escalation of the North Korean crisis.”

Among other metals, December silver US:SIZ7 fell 7.8 cents, or 0.4%, to $17.789 an ounce, while December copper US:HGZ7 declined by 2.4 cents, or 0.8%, to $2.958 a pound.

October platinum US:PLV7 settled at $980.90 an ounce, down $2.30, or 0.2%, and December palladium shed $19.40, or 2.1%, to $914.30 an ounce, extending its loss of 1% from Wednesday.