NEW YORK — U.S. stocks slid, following equities’ biggest gain since May, as China’s currency devaluation sparked concern across global markets that the world’s second-largest economy is headed for a deeper slowdown.

Companies that rely heavily on exports to China, including auto and luxury goods makers, retreated. General Motors and Tiffany & Co. lost more than 2.1 percent. Apple sank 5.2 percent. Commodity producers from Freeport-McMoRan to Dow Chemical fell at least 2.9 percent amid concerns about China’s growth. Google advanced 4.1 percent after saying it will reorganize into a holding company called Alphabet.

The Standard & Poor’s 500 Index declined 1 percent to 2,084.07 at 4 p.m. in New York, holding above its average price during the past 200 days. The Dow Jones industrial average slumped 212.33 points, or 1.2 percent, to 17,402.84, its worst drop in a month. The Nasdaq Composite Index decreased 1.3 percent. About 7.1 billion shares traded hands on U.S. exchanges, 9 percent above the three-month average.

“The driving forces today continue to be macro-oriented with China the most important,” said Tom Wright, the New York-based director of equities at JMP Securities. “We spend a lot of time obsessing over Greece or Puerto Rico, but China is a much bigger economy and a much bigger problem to the global economy and devaluing the currency is shaking people up.”

China devalued the yuan by 1.9 percent, the most in two decades, after data this month showed a plunge in exports, weaker-than-estimated manufacturing and a slowdown credit growth. The surprise move rippled through global markets, sparking sell-offs in emerging-market currencies, commodities, and auto and luxury stocks with exposure to China.

A rally in commodities from oil to copper helped the S&P 500 jump 1.3 percent on Monday. Those trades largely reversed Tuesday on concern demand from China, the world’s biggest consumer of energy and metals, will slow and yuan weakness will erode the buying power of Chinese consumers. Similar worries about the country’s growth helped send the benchmark index down as much as 4 percent last month from its May record.

Raw-material companies in the S&P 500 retreated 1.9 percent after the biggest year-to-date gain yesterday. Miner Freeport- McMoRan plunged 12 percent, the most since 2012 and eclipsing Monday’s 11 percent climb. Alcoa Inc. sank 6 percent after a 7.1 percent jump yesterday.