"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.
Read MoreRumors of commodities' demise are not being exaggerated
"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.