"Stocks can't go down every day," said Art Hogan, chief market strategist at Jefferies & Co.
A slew of early data had the Institute for Supply Management reporting nonmanufacturing sectors of the U.S. economy contracted at a slower pace during February, with its index bouncing to 49.3 in February from 44.6.
"We had a pleasant surprise from ISM, which came in significantly higher than expected. And. the nonmanufacturing sector is about 85% of the U.S. economy," said Hogan,
Up 50 points ahead of the latest economic data, the Dow Jones Industrial Average added to its opening gains. The blue-chip barometer was recently ahead 91.67 points at 12,305.47.
Of the Dow's 30 components, 24 were on the rise, led by shares of Microsoft Corp. , up 2.4%. Other blue-chip gainers included Home Depot Inc. , up 0.8%, and E.I. duPont de Nemours & Co. , up nearly 2%.
The S&P 500 rose 11.65 points to 1,338.40 and the Nasdaq Composite added 21.84 points to 2,282.12.
Volume on the New York Stock Exchange topped 402 million, and advancing stocks outran those declining 2 to 1. On the Nasdaq, 307 million shares were exchanged, and advancing issues overtook those declining 3 to 2.
Reports regarding a prospective bailout of Ambac Financial Group were back on the table. The reports fueled a late-day rally Tuesday, pulling U.S. stock indexes off earlier lows.
Hopes of a rescue for the troubled bond insurer helped propel financial shares higher, with Ambac up 9.6% and MBIA Inc. , a rival bond insurer that has already raised $2.6 billion in new capital, rising 5.8%.
Early trade had technology stocks largely on the rise, with bellwether Cisco Systems Inc. edging up after Chairman and CEO John Chambers expressed increased comfort with the networking titan's longer-term growth prospects.
And, Yahoo Inc. gained 0.3%. The Internet-search company, facing a hostile takeover attempt mounted by Microsoft Corp. , extended its deadline for nominating directors to its board.
Costco Wholesale Corp. was down nearly 1.6% after its report of 31% growth in quarterly profit met expectations, while Big Lots Inc. gained nearly 22% after reporting a 12% profit fall.
Also, the nation's private sector shed 23,000 jobs in February, according to an employment report based on ADP payrolls data. Adding in some 25,000 jobs typically created by government, the ADP report suggests nonfarm payrolls grew by about 2,000, compared to the 20,000 forecast by economists. .
Meanwhile, data tracking productivity in U.S. nonfarm businesses and unit labor costs -- a key inflation gauge -- were revised slightly higher in the fourth quarter from prior estimates. .
A separate report had the Commerce Department reporting a 2.5% January decline in factory orders. .
On the New York Mercantile Exchange, crude-oil futures rose to $102.65 a barrel, up $3.13, as OPEC left production unchanged, while gold advanced $19.30 to stand at $985.80 an ounce.
Overseas markets were split, with Asian stocks generally posting a flat performance, while stocks in Europe rose after five straight losses.
The Nikkei 225 ended 0.2% lower in Tokyo, while the German DAX 30 rose 1.2%.
By Kate Gibson