Stocks rose unexpectedly in a late rally Tuesday after U.S. Treasury Secretary John Snow said the United States was calling on Beijing to take only an intermediate step toward flexibility for its yuan currency.

The Dow Jones industrial average (search) rose 79.59 points, or 0.78 percent, to end at 10,331.88. The Standard & Poor's 500 Index (search) gained 8.11 points, or 0.70 percent, to finish at 1,173.80. The technology-laced Nasdaq Composite Index (search) advanced 9.72 points, or 0.49 percent, to close at 2,004.15.

"We are not calling for an immediate full float with fully liberalized capital markets," Snow said in a prepared statement. "This would be a mistake at this time -- China's banking sector is not prepared."

Investors, who had feared deterioration of trade relations between the United States and China, welcomed the moderate tone of Snow's remarks.

Meanwhile, solid earnings from companies, including Home Depot (HD) , appeared to offset mixed economic data on producer prices and housing starts. Home Depot, the largest U.S. home improvement chain, rose 4 percent or $1.49 to $38.86, helping the blue-chip Dow average and the broader S&P 500.

China's yuan currency is pegged to the dollar in international trading, which has made China far more competitive than the U.S. due to its lower costs and centralized economy.

U.S. exporters claim the yuan is as much as 40 percent undervalued, making Chinese goods unfairly cheap. While not outright accusing China of currency manipulation, the Treasury Department had said it may do so in the future unless the Chinese government switches to a flexible exchange system.

"Maybe there was some kind of concern we were going to have a trade war with China," said Peter Boockvar, equity strategist at Miller Tabak & Co. "It sounds ridiculous, but I guess that's the only reason you can point to."

Richard Hoey, chief economist at Mellon Financial Corp., said, "This is a kind of straddle decision, but it doesn't set off an escalating disagreement between the Chinese and U.S. governments."

The market began the day lower after the Labor Department's (search) Producer Price Index showed higher-than-expected increases in wholesale prices. With the counterpart Consumer Price index due before Wednesday's session, analysts warned that Wall Street's late rally could be short-lived.

"It's encouraging to see these kind of gains two days in a row, and I guess I'm cautiously optimistic," said Neil Massa, an equity trader at John Hancock Funds. "But all this can be erased tomorrow with one number."

The bond market advanced, with the yield on the 10-year Treasury note falling to 4.12 percent from 4.13 percent late Monday. The dollar lost ground against other major currencies after big gains in the past few sessions, and gold prices rose.

Crude oil futures closed moderately higher, though the Treasury's stance on China helped Wall Street shrug off the increase. A barrel of light crude settled at $48.97, up 36 cents, on the New York Mercantile Exchange (search).

The fact that core PPI rose more than expected led investors to the conclusion that the effect of higher raw materials and other pricing pressures were taking hold. The big fear is that those prices would be passed along to consumers, which would either choke off economic growth or spur inflation.

But the latest figures show core inflation remains under control, said Michael Bee, lead equity strategist at Boyd Watterson Asset Management LLC, a Cleveland, Ohio-based firm with $3.7 billion under management.

"There is probably some inflation that has slipped through to wholesale ... from the rise in material and energy costs," he said. "It is out belief that raw materials costs will be coming down in energy specifically, and companies are going to be at an advantage to maintain margins in that environment."

The bond market edged higher as stocks fell, with the yield on the 10-year Treasury note falling to 4.12 percent from 4.13 percent late Monday. The dollar lost ground against other major currencies after strong gains in the past few sessions, and gold prices rose.

After the closing bell, shares of Hewlett-Packard Co. (HPQ) rose 4 percent to $22.41 on the Inet electronic brokerage system after the No 2 computer posted a higher quarterly profit. Hewlett-Packard, among the 30 stocks in the Dow, also said revenue rose across all its businesses.

Those investors still feeling bullish were buoyed by the latest Commerce Department report on housing starts, which rose 11 percent in April. Economists had been predicting slower growth in home construction, but it appeared that the Federal Reserve's steady pace of interest rate hikes has not muted the booming housing market.

"Housing starts were definitely positive," said Jim Fehrenbach, head of Nasdaq trading at Piper Jaffray, of Minneapolis. He added that while the PPI numbers exceeded forecasts only slightly, there was a "lack of conviction" among investors as to the strength of the U.S. economy.

Department store chain J.C. Penney & Co. Inc. (JCP ) rose $1.52 to $49.35 after it quadrupled its quarterly earnings from a year ago, citing strong gains in its online shopping division. The company beat analysts' forecasts by 2 cents per share.

Research In Motion Ltd. (RIMM), maker of BlackBerry wireless email devices, rose 3.6 percent, or $2.54, to $72.45 after the company's co-CEO said it is aiming to launch commercial service in China by year end during a rapid expansion in Asia.

Among declining stocks, Merck & Co. Inc. (MRK) weighed on the main stock indexes after a note by investment bank CSFB raised doubts about the large drug company's margins.

Merck, a member of both the Dow & the S&P 500, fell 1.3 percent or 44 cents to $33.01 after CSFB said in a research note that "Merck's recent gross margin trends may be overstated based upon our analysis of the company's accounting for long-term inventory.

"These practices are unlikely to be sustainable, may lead to future charges and may add risk to upcoming gross margin performance," CSFB's note said, regarding Merck.

Discount bulk retailer BJ's Wholesale Club Inc. (BJ) saw a 16 percent gain in first-quarter profits, beating Wall Street's forecasts by a penny per share after one-time charges. The company also posted 5.8 percent sales growth in stores open at least a year. BJ's gained $1.29 to $29.59.

And office supplies retailer Staples Inc. (SPLS) added $1.02 to $21.56 as it posted a 27 percent rise in profits and beat Wall Street's profit expectations by a penny per share. Sales grew at a moderate pace, but the chain's North American delivery business showed surprising strength.

Trading was moderate, with 1.49 billion shares changing hands on the New York Stock Exchange, just above the 1.46 billion daily average for last year. About 1.56 billion shares were traded on Nasdaq, below the 1.81 billion daily average last year.

Advancing stocks outnumbered decliners on the NYSE by about 7 to 4 and on Nasdaq by roughly 8 to 7.

The Russell 2000 index of smaller companies was down 3.04, or 0.5 percent, at 588.67.

Overseas, Japan's Nikkei stock average tumbled 1.11 percent. In Europe, Britain's FTSE 100 closed up 0.29 percent, France's CAC-40 lost 0.12 percent for the session, and Germany's DAX index fell 0.24 percent.

Reuters and the Associated Press contributed to this report.