U.S. stocks rose about 1 percent on Friday as mildly encouraging retail sales put the S&P on track for a two-day winning streak for the first time since mid-July as investors shrugged off weak consumer sentiment data.
Still, the market was on track for its worst three-week decline since March of 2009, when stocks hit 12-year lows.
Trading remained volatile, with stocks retreating after the sentiment reading, then rebounding by midday.
U.S. consumer sentiment fell to its lowest level since 1980, but retail sales posted their biggest gains in three months in July.
"On the whole, the market just went overboard and discounted a lot of terrible things that probably won't happen." said John Carey, portfolio manager at Pioneer Investments in Boston.
"At some point people will look around and see that a lot of stocks are very attractively priced."
The Dow Jones industrial average gained 143.50 points, or 1.29 percent, to 11,286.81. The Standard & Poor's 500 Index rose 9.90 points, or 0.84 percent, to 1,182.54. The Nasdaq Composite Index added 18.43 points, or 0.74 percent, to 2,511.11.
If the S&P 500 ends higher, it will be the index's first two-day streak since July 21-22. It has fallen for 11 of the past 14 days.
European shares closed up 3.6 percent, helped by a short-selling ban on financial shares by France, Italy, Spain and Belgium and European Central Bank data that eased fears some banks faced liquidity issues.
"That's been part of the problem. The political leadership here and in Europe has been uninspiring and indecisive, so the markets have had to sort out a lot of things for themselves and it's been a real struggle," said Carey.
Among individual stocks, Nvidia Corp shed 1.9 percent to $13.16, giving back early gains a day after it forecast a larger-than-expected jump in revenue. Some analysts were surprised with the lack of growth of one of its much-touted processors.
Dillard's Inc slumped 16.1 percent to $42.56 after it posted quarterly profits below estimates.
The majority of S&P indexes were in positive territory. Advancers beat decliners on the New York Stock Exchange by about three-to-one, while the ratio on the Nasdaq was about three-to-two.
(Reporting by Chuck Mikolajczak; editing by Jeffrey Benkoe)