The S&P 500 and the Nasdaq gained on Tuesday as investors welcomed further signs of improvement in the manufacturing sector, brushing off a sharp slump in pending home sales for November.

U.S. stocks briefly extended losses after the National Association of Realtors said pending home sales dropped 16 percent after rising for nine straight months.

But the losses were erased after the government said new factory orders rose 1.1 percent in November for their third straight increase. The data suggested the manufacturing sector would continue to support an overall economic recovery.

I think people are more willing to shake off these November pending home sales numbers and focus more on the factory orders number, which had an upward revision for the prior month. It's a much more positive economic sign, said Marc Pado, U.S. market strategist at Cantor Fitzgerald & Co in San Francisco.

The Dow Jones industrial average <.DJI> was down 10.96 points, or 0.10 percent, at 10,573.00. The Standard & Poor's 500 Index <.SPX> was up 2.10 points, or 0.19 percent, at 1,135.09. The Nasdaq Composite Index <.IXIC> was up 3.12 points, or 0.14 percent, at 2,311.54.

Investors will get a fresh picture on the state of consumer spending as automakers report U.S. vehicle sales for December. Economists expect median annualized domestic sales of 3.90 million cars and 4.45 million trucks, versus 3.87 million cars and 4.44 million trucks sold in November.

(Reporting by Angela Moon; editing by Jeffrey Benkoe)