Gold rose for a fifth session in a row on Wednesday, hitting a fresh three-week high as the dollar and global equities slid on concerns over China's devaluation of its currency.
Earlier in the day, the People's Bank of China set the yuan's midpoint reference rate weaker than Tuesday's surprise 2 percent devaluation.
The move sparked fears of a currency war and hit global equities, prompting some investors to seek assets perceived as safer such as gold. The metal has now recovered more than 4 percent from a 5-1/2-year low of $1,077 hit during a late-July rout.
was up 1.3 percent at $1,124 to its highest since July 20. U.S. gold for December delivery gained 1.4 percent to settle at $1,123.60 an ounce.
"The bears have been running the show now for some time and that devaluation (on Tuesday) was a bit of a bash in the eye for the bears... but we haven't seen any strong fresh buying, it is more a short-covering rally," bullion broker Sharps Pixley chief Ross Norman said.
Gold was lifted by a weaker dollar, down 1.1 percent against a basket of currencies, and lower U.S. Treasury yields on doubts over whether the U.S. Federal Reserve will raise interest rates following China's devaluation.
"It's benefiting gold the most as major currency debasement should and would expect gold to test key resistance at $1,130," said Tai Wong, director of base and precious metals trading for BMO Capital Markets, referring to the yuan devaluation.
"It's unclear how much more yuan devaluation we will see so gold sellers are likely to hold fire at the moment."
The weaker yuan would make it more expensive for China, the world's top consumer, to import gold, said OCBC Bank analyst Barnabas Gan.
"The potential for the monetary authorities to further devalue the currency may raise fears of inflation and may raise more general concerns about official intervention in financial markets," said David Jollie, head of research for Mitsui and Co Precious Metals, in a note.
"This could bring forward some customer purchasing of jewelry or other expensive items, potentially boosting demand for gold and platinum in particular."