"The economic news, by and large, isn't bad here," said Phil Orlando, chief equity strategist at Federated Investors. "Maybe investors are starting to think that this thing is going to grind higher."
The Standard & Poor's 500 index rose 13.09 points, or 0.7 percent, to 1,973.32. The Dow Jones industrial average gained 129.47 points, or 0.8 percent, to 16,956.07. The index climbed as high as 16,998.70 in early afternoon trading before falling back slightly.
The Nasdaq composite rose 50.47, or 1.1 percent, to 4,458.65.
Stocks climbed from the open after HSBC said its Chinese purchasing managers index rose to 50.7 in June from 49.4 a month earlier. Numbers above 50 signal growth. The market added to its gains after a separate survey showed that U.S. manufacturing kept growing, even as the pace of the expansion slowed from May.
Gains for the stock market were broad and nine of the 10 industry sectors that make up the S&P 500 rose on Tuesday. Utilities were the only sector to fall.
Health care stocks logged the biggest advance. The gains being led by Regeneron. The drug maker rose $19.53, or 7 percent, to $301.94 after the French drugmaker Sanofi said in a regulatory filing that it had raised its stake in the company to 22.5 percent from about 20 percent in April. Sanofi and Regeneron are collaborating on drug research and have an agreement that Sanofi won't acquire more than a 30 percent stake in the company.
The Standard & Poor's 500 index has now gained 6.8 percent this year, after jumping almost 30 percent a year ago. While stocks are no longer cheap after their recent gains, they are still a compelling investment compared to buying bonds or holding cash with interest rates close to zero, said Joe Tanious, a global market strategist at JPMorgan Funds.
"In the long run market prices are dictated by the fundamentals," said Joe Tanious, a global market strategist at JPMorgan Funds. "And the underlying fundamentals suggest that markets can move higher from here."
Government bonds prices fell. The yield on the 10-year Treasury note climbed to 2.56 percent from 2.53 percent late Monday. Bond prices have risen this year, pushing interest rates lower, even as the Federal Reserve has reduced its economic stimulus and the economy has improved.
Among other stocks making big moves:
Netflix jumped $32.50, or 7.4 percent, to $473.10 after analysts at Goldman Sachs raised their outlook for the streaming video company. Goldman estimates that Netflix's potential audience of subscribers will double over the next three years to 207 million people as the company expands internationally. The analysts have a 12-month price target of $590 on the stock.
Twitter rose $1.08, or 2.6 percent, to $42.05 after analysts at Stern Agee raised their estimates for the company's earnings for next year and said that the social media company should benefit from increased use during the World Cup. The company also said today that it was hiring Anthony Noto, a Goldman Sachs executive, as its new chief financial officer.
GM gained $1.29, or 3.6 percent, to $37.59 says its U.S. sales rose 1 percent in June. Sales were led by the Buick Encore small SUV, up 82 percent. The redesigned Chevrolet Tahoe big SUV also had a strong month with sales almost doubling.