Gold rose to a three-week high on Tuesday as global stocks fell, and investors assessed the impact of China's nearly 2 percent devaluation of its currency and move to prop up its economy.
Beijing allowed the yuan to fall to its lowest level in nearly three years after a run of poor economic data.
China's rate decision triggered a sharp but short-lived retreat in gold to a session low of $1,093.25 an ounce.
rebounded to a three-week high of $1,119 before trading up 0.3 percent at $1,108.05 an ounce. U.S. gold for December delivery settled up 0.3 percent at $1,107.70 an ounce.
"Gold is benefiting from fears that this is a new round of 'currency war,"' Macquarie analyst Matthew Turner said, adding that the move increased uncertainties and risks about the global economy, which tends to be good for gold.
"Gold's best moment this year came in the first few months when we saw various FX swings, lots of different central banks cutting interest rates or intervening in their monetary policy, so probably there is some element of that which has helped the rally from Monday continue a bit," Turner said.
Economists and U.S. Federal Reserve watchers said China's currency devaluation is unlikely to distract the Fed from a domestic economy that appears increasingly ready for higher interest rates.
Investors have cut their exposure to non-interest-bearing bullion and raised their bets on the dollar on expectations that the Fed would lift rates this year for the first time since 2006.
"Any type of delay or expectation that the Fed could remain more patient, maybe delay the September rate hike, that's certainly something that is taken into consideration in the positive side of the market," said David Meger, director of metals trading for High Ridge Futures in Chicago.
In the medium to long term, however, analysts do not expect China's yuan devaluation to bolster gold's value as this would have to be followed by a wider round of global devaluations.
"In the longer term, China's devaluation is a slight headwind for gold, as it makes it a little bit more expensive from a Chinese perspective," Julius Baer commodity analyst Warren Kreyzig said.
China's currency move pushed the U.S. dollar higher and hit Wall Street and other global equity markets.