"While other housing data remains weak, today's housing report is clearly encouraging," said Michael Sheldon, chief market strategist at Spencer Clarke.
The Dow Jones Industrial Average jumped 80 points to 13,606, after hitting a new record high of 13,624.
Among blue chips, Boeing Co. gained 3.3%, bouncing back from the previous session when it affirmed its earnings outlook for 2007 and 2008.
General Motors fell 0.1%, but was off earlier lows. In a filing with the Securities and Exchange Commission, GM said it sees a $7 billion exposure from helping Delphi get out of bankruptcy. GM previously said it would cost between $6 billion and $7.5 billion.
The S&P 500 gained 4.5 points to 1,526, while the Nasdaq Composite rose 4.3 points to 2,581.
Adding to the buying frenzy, Advanced Medical Optics said it was interested in buying Bausch & Lomb Inc. at a higher price than the $3.67 billion offered by a private equity group.
Trading volumes showed 428 million on the New York Stock Exchange and 579 million on the Nasdaq stock market. Advancing issues topped decliners by 16 to 13 on the NYSE, while declining issues topped gainers by 7 to 6 on the Nasdaq.
By sector, airlines , financials and consumer issues led the gains, while and software declined.
Economy back in play
Stocks jumped after news that sales of new U.S. homes unexpectedly surged 16% in April, to a seasonally adjusted annual rate of 981,000, the Commerce Department said Thursday.
The number far exceeded the 865,000 pace expected.
Sales, however, were boosted by plunging prices. While the inventory of unsold homes fell by 1.5%, the median price of a new home plunged 10.9% over the past year.
"This is a blockbuster number but the beneath the curtain, we still see signs of weakness," said Kathy Lien, chief strategist at DailyFX.com.
The huge drop in the price of median homes, she noted, "means that builders are basically putting a fire sale on inventory."
"What will be most important is whether there is a divergence between existing and new home sales tomorrow as existing home owners may be more price sensitivity and in less of an urgency to sell," she said.
The data still helped offset concerns about homebuilders. Toll Brothers rebounded 3.2%. It earlier fell after reporting a huge drop in earnings compared with the year earlier. Toll Brothers also said that it's not comfortable giving full earnings guidance.
Among other homebuilders, shares of Hovnanian Enterprises Inc. jumped 2.4% and KB Home rose 2.4%.
The market had already received better-than-expected news about business spending.
New orders for U.S.-made durable goods increased 0.6% in April, boosted by strong demand for metals.
Orders in March rose a revised 5%, a six-month high, compared with a 4.3% estimate previously. Orders for core capital equipment goods - the best monthly gauge of business investment - rose 1.2% after a 4.4% gain in March.
Economists surveyed by MarketWatch were looking for no change in durable goods orders in April. The data seems to confirm other data showing improvement in the manufacturing sector.
On Wednesday, the market reversed previous gains to close lower, after Greenspan said he feared the Chinese stock market was headed for a "dramatic correction."
Overnight, the Shanghai Composite fell 0.5%.
U.S. stocks, which have rallied almost without interruption since mid-March, fell back as trading volumes were light in the run up to the three-day Memorial Day weekend, traders said.
"While this did not derail the rally, the major indices did close in the red after they all had made new intra-day highs," said Marc Pado, market strategist at Cantor Fitzgerald. "That makes it a minor reversal day to the downside for the broad range of indices. "
"It would require a follow-through day to the downside" to confirm a real trend reversal, Pado said.
Crude-oil futures held below $66 a barrel, after Energy Department data that indicated a buildup in the nation's crude supplies last week. Futures were down 6 cents at $65.71 a barrel in recent action.
But gasoline futures rose 1.16 cents to $2.3220 a gallon amid continued concerns about gasoline supplies through the summer driving season.
Gold futures slipped $2.0 to $660.60 an ounce.
The dollar was up against the euro and flat against the yen.
Bonds fell after the housing and durable goods data.
Network Appliance stumbled 11.5% after the storage-technology company said a brief slowdown in March will cause it to deliver weaker-than-forecast results for its current quarter. "We hit an airpocket and we never made up the difference," according to CFO Steve Gomo.
Software companies CA and Synopsys also issued earnings outlooks below market expectations.
Limited Brands also rebounded from early weakness, gaining 0.1% after reporting a 47% profit fall and saying sales at Victoria's Secret continue to be weak.
Apparel retailers Gymboree and Abercrombie & Fitch all rose after their quarterly results.
By Nick Godt