Stocks closed higher in thin trading Friday, but snapped a two-week rally amid ongoing uncertainty over the government's ability to reach a debt-reduction deal and some growing concerns over the economy.
The Dow Jones Industrial Average gained 42.61 points, or 0.34 percent, to finish at 12,479.73, after see-sawing for most of the session.
The S&P 500 rose 7.27 points, or 0.56 percent, to close at 1,316.14.
The tech-heavy Nasdaq climbed 27.13, or 0.98 percent, to end at 2,789.80.
The CBOE Volatility Index, widely considered the best gauge of fear in the market, finished near 20.
For the week, the Dow fell 1.4 percent, the S&P declined 2.06 percent, while the Nasdaq slid 2.45 percent.
Energy was the only gainer for the week among S&P sectors, while financials were the biggest laggards. For the week, ExxonMobil was the biggest gainer on the blue-chip index, while BofA lagged for the second week.
Citigroup slipped after the bank's profits surged, topping estimates, as the firm's revenue was essentially flat from the previous year. Rivals JPMorgan and BofA also fell.
Eight banks—including two Greek banks, five Spanish and one Austrian bank—have failed the European Banking Authority's (EBA) stress tests, according to the agency.
Meanwhile, Standard & Poor's put a broad range of financial firms on negative credit watch, warning they could all be downgraded if the U.S. has its credit rating cut.
The rally lost steam after consumer sentiment fell in July to the lowest level since March 2009amid increasing pessimism over falling income and rising unemployment, according to the Thomson Reuters/University of Michigan survey.
"Of course sentiment is lower," according to Todd Schoenberger, managing director of LandColt Trading. "The only surprise here is the number didn't drop nearly as much as it should have!"
"Macro data has been horrible the past couple of months... [Jobless] claims at 405,000 isn't a bright spot—14 straight weeks we've been north of 400,000," Schoenberger explained. "EPS growth rate for this earnings season is expected to be 13.5 percent, the slowest since the recession, dare I say it, ended!"
Also among earnings, Google soared to lead the S&P 500 leaders after the search-engine giant reported earnings that exceeded even the most bullish forecasts. At least three brokerages raised their price target on the search-engine giant. Chinese "Google" Baidu also traded higher.
A slew of earnings are expected next week with nearly half the firms on the Dow such as Coca-Cola , BofA and Microsoft poised to report. Other notable firms include Goldman Sachs and Apple .
Apple gained after at least two brokerages raised their price targets on the iPod maker. IBM also rose after Collins Stewart raised its price target on the tech giant to $200 from $185.
Gold reach an all-time high, soaring $48.60, or 3.15 percent, this week to settle at $1589.80 an ounce. Oil prices gained as U.S. light, sweet crude rose near $97 a barrel and London Brent crude climbed above $117.