A late rally Friday prevented the stock market from having its worst week in nearly a year.
Investors seemed to largely ignore the ongoing debate in Washington over raising the country's borrowing limit. Troubling questions over Europe's financial health and manufacturing in the U.S. weighed down stock prices for much of the day, overwhelming a very strong earnings report from Google Inc.
Google jumped nearly 13 percent, the most of any stock in the Standard and Poor's 500 index, after the company said its revenue hit a record last quarter. Google's earnings pushed tech stocks in the S&P index broadly higher. Microsoft Corp. and Cisco Systems Inc. each gained 1 percent.
Worries about Europe and weak factory output in the U.S. have kept traders' expectations and stock prices relatively low since early this spring, said Ryan Detrick, senior technical strategist Schaeffer's Investment Research. If corporate earnings remain strong and Europe stabilizes, he said, stocks might rally in the second half of the year. That happened last year, after fears about Europe held the stock market back all summer.
"With all the talk about European debt and the U.S. issues, the fact that earnings are coming in pretty strong is a good sign," Detrick said. "Once those issues work their way through the system, long-term growth is going to come from earnings."
Most investors believe a deal to raise the country's debt ceiling will be reached before the Aug. 2 deadline. Standard & Poor's said Thursday there is a 50 percent chance it will downgrade the government's triple-A rating within three months because of the impasse. Moody's made a similar warning on Wednesday. Even so, there has been little visible progress in negotiations between President Barack Obama and Congressional Republicans.
The Standard and Poor's 500 stock index finished with a gain of 7.27, or 0.6 percent, to 1,316.14. Most of the gains came in the last hour of trading.
The Dow Jones industrial average added 42.61, or 0.3 percent, to 12,479.73. The Nasdaq composite rose 27.13, or 1 percent, to 2,789.80.
The late gains Friday trimmed the S&P 500's weekly losses to 2.1 percent. Had the index closed where it was at 2:30pm it would have been down 2.6 percent for the week, making it the worst week for the widely used market measure since last August.
The S&P 500 has only had two up days out of the last six as Italy appeared to be the next European country headed for a fiscal calamity. Those concerns ebbed Friday after Italy passed new austerity measures and Europe's banking authority said only eight banks out of 90 failed the latest round of "stress" tests designed to measure how they would stand up under severe financial strains.
Energy stocks rose 2.4 percent after Australian natural-resource giant BHP Billiton Ltd. said it would buy Petrohawk Energy Corp. for $12.1 billion, feeding speculation about which company might be the next takeover target. BHP was attracted to the long-term value of Petrohawk's U.S. natural gas reserves. Chesapeake Energy Corp., Cabot Oil & Gas Corp and Pioneer Natural Resources Co. each rose 10 percent. Natural gas prices rose 3.7 percent.
Mattel Inc. rose nearly 2 percent after the company said its income jumped 56 percent in the second quarter, helped by strong demand for Barbie and "Cars 2" toys. Clorox Co. jumped 9 percent after billionaire investor Carl Icahn offered to take the company private in a deal that values the household products company at $10.2 billion. Icahn offered 12 percent more for shares than they were worth at Thursday's close.
Bank of America closed at $10 after briefly dipping below that mark for the first time since May 2009. The company, which is expected to report Tuesday that it lost money in its most recent quarter.
Three stocks rose for every two that fell on the New York Stock Exchange. Volume was slightly higher than average at 4 billion shares.
The Dow average fell 1.4 percent for the week, the Nasdaq 2.4 percent.