NEW YORK – Stocks rallied Tuesday, with the Standard & Poor’s 500 Index erasing its loss for the year after reports showed New York area manufacturing expanded for an 11th month and prices of imported goods declined.

The S&P 500 advanced 2.4 percent to 1,115.23, its highest level since May 18. The Dow Jones industrial average surged 213.88 points, or 2.1 percent, to 10,404.77, its highest close since May 19.

“The data give support to a modest recovery and where the market is today,” said Tom Wirth, senior investment officer for Chemung Canal Trust Co. in Elmira, N.Y. “We’ve had a correction and the market is settling in at a very reasonable valuation. I doubt we are going to have much more of this corrective phase of the bull market.”

The rally sent the S&P 500 about 6.5 points above its average level in the past 200 days, a move considered significant by investors who base trading decisions on chart patterns. The S&P 500 increased to near the 200-day mean on June 3 and May 27 before losing as much as 5 percent in the next two days.

All 57 stocks in the S&P 500 industrials index gained after the Federal Reserve Bank of New York’s general economic index increased to 19.6, in line with the median forecast of economists surveyed by Bloomberg News. Prices of goods imported into the United States fell 0.6 percent in May, led by the biggest drop in petroleum costs since December 2008, the Labor Department said.

Semiconductor stocks rallied after Taiwan Semiconductor Manu- facturing, the world’s largest contract maker of chips, boosted this year’s market forecast. The company’s U.S.-traded shares climbed 4.3 percent to $10.27. Teradyne rallied 11 percent to $11.77 for the biggest gain in the S&P 500. Micron, the biggest U.S. producer of computer memory, increased 8.6 percent to $9.68. Intel, the world’s largest chipmaker, rose 2.8 percent to $21.48.

Microsoft rose the most since October, jumping 4.3 percent to $26.58 for the biggest gain in the Dow. International Data Corp. reiterated its projection for 20 percent growth in global PC shipments in 2010 and said desktop computer sales are recovering.