Spot gold was down 0.2 percent at $1,279.49 an ounce at 2:02 p.m. ET, having earlier touched its highest since June 15 at $1,288.66.
U.S. gold futures settled $2.80 higher at $1,284.10 an ounce.
“A sell-off in the stock markets today is prompting some safe-haven demand,” said Jim Wyckoff, senior analyst at Kitco Metals.
“Gold prices hit a six-month high and the trend is up on a near-term basis which is inviting technical-based buying interest. Probably some new speculative fund money coming into the market combined to push gold prices higher despite the stronger dollar.”
The dollar index rose against the euro and sterling on Wednesday.
World shares started the year on a gloomy note with poor data across Asia, the euro zone and the United States that prompted investor flows into safe haven assets, such as the yen, Treasuries and bullion.
Euro zone manufacturing activity barely expanded at the end of 2018 in a broad-based slowdown, while China’s factory activity also contracted for the first time in 19 months in December.
Gold priced in euros jumped to 1,134.08 euros an ounce, its highest level since mid-June 2017. In sterling terms, gold climbed to its highest level since early September 2017, at 1,022.80 pounds an ounce.
“There is some fading optimism for the euro zone area which is giving gold quite a good lift. It is a continuing trend of what we’ve seen in the latter part of last year,” said Ross Norman, chief executive officer of Sharps Pixley.
Spot gold prices gained about 5 percent last month, the most since January 2017. Some investors expect the precious metal to pass the $1,300 psychological resistance level in the near-term.
Markets are now awaiting views from Federal Reserve Chairman Jerome Powell on the U.S. economic outlook and hints about interest rates in 2019 when he participates in a joint discussion on Friday with former Fed heads Janet Yellen and Ben Bernanke.
There are expectations that a three-year rate-hiking cycle in the United States has come to a close, which would be beneficial for non-yielding bullion.
Further pointers are expected this week from a closely watched survey on U.S. manufacturing, due on Thursday, followed by the December payrolls report on Friday.
Among other precious metals, palladium rose 0.16 percent to $1,266 an ounce.
Silver stayed flat at $15.45, having earlier touched its highest since July 31 at $15.61, while platinum fell 0.15 percent to $790.30.