Gold prices rallied to their highest level in a month on Thursday as losses in U.S. stocks and weaker economic data pushed some investors to buy the metal as a haven.

The most actively traded contract, for December delivery, rose $22.30, or 2%, to settle at $1,153.80 a troy ounce on the Comex division of the New York Mercantile Exchange. This was the highest close since Aug. 21.

Gold...