Excluding automobile sales, retail sales rose 0.8% in July after being down 0.8% in June.

Also, the Labor Department said the producer price index rose 0.3% in July after a 0.1% increase in June. The PPI was predicted to have risen 0.2%. Excluding the food and energy components, the PPI was up 0.4% in July after being up 0.2% in June.

"While both were firmer than expected, it's retail sales that takes center stage with widespread gains only partially offset by further downward revisions in the prior month," said David Ader, a strategist at CRT Capital Group.

"Combined with the solid payroll report for June, today's retail sales data further reduces the likelihood of QE3 in September but does not take it off the table, in our view," said Michelle Meyer, senior U.S. economist at Bank of America.

The Commerce Department also said business inventories ticked up 0.1% in June -- compared with the expected gain of 0.2%, after rising by 0.3% in May -- as U.S. companies opted to keep their stockpiles lean amid sluggish sales in the period.

A sequential slip in the National Federation of Independent Business's small business optimism index for July kept enthusiasm in check as respondents expressed concerns about earnings and a disheartening business inventories report.

September crude oil futures settled up 70 cents at $93.43 a barrel and December gold futures settled down $10.20 at $1602.40 an ounce.

The benchmark 10-year Treasury was diving 20/32, raising the yield to 1.735%. The greenback was up 0.14%, according to the dollar index.

The FTSE in London closed up 0.56% and the DAX in Germany settled up 0.94% after data showed that Germany's economy grew by 0.3% in the second quarter, better than the 0.2% rise that economists had expected. France's economy didn't grow in the second quarter, but that was still better than the expected 0.1% contraction.

In aggregate, eurozone gross domestic product shrank by 0.2% in the second quarter, in line with the consensus forecast.

The Hong Kong Hang Seng index settled ahead by 1.05% and the Nikkei in Japan closed up 0.50%.

If you liked this article you might like

Forecast for S&P 500, Dow Industrials Remains Bullish, These Charts Show

Dow 20,000! It Should Mean Nothing to Investors, but Then Again...

Tradebird Investors Are Bullish on U.S. Stocks but Bearish on the Euro

Why Home Depot and Boeing Stock Fell Tuesday