The Dow and S&P 500 turned decisively higher in the final minutes of trading to close at their best level since December 2007 and all three major averages turned in their third-straight weekly gain.
Stocks wavered around the flatline for most of the session following a weaker-than-expected consumer sentiment report and a mixed batch of corporate earnings. (Read More: Why This Bull Market Gets No Respect)
The Dow Jones Industrial Average gained 53.68 points, or 0.39 percent to close at 13,649.30, led by GE, while Intel tumbled.
The S&P 500 climbed 5.04 points, or 0.34 percent, to end at 1,485.98. The Nasdaq slipped 3.91 points, or 0.14 percent, to finish at 3,134.71. The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, fell near 12 to close at its lowest level since April 2007.
For the week, the Dow jumped 1.20 percent, the S&P 500 advanced 0.95 percent, and the Nasdaq rose 0.29 percent. Hewlett-Packard was the best weekly performer, while Bank of America slumped.
Among the key S&P sectors, energy and industrials were the best performers for the week, while telecoms and techs lagged.
"This has been a good consolidation week and it's nice to see the S&P 500 hold in the 1,470 to 1,480 range," said Christian Thwaites of Sentinel Investments. "The economic numbers are becoming right on the screws…The earnings are a little bit wayward, but we're only early into this and next week will be a much more meaningful earnings week. But the news has generally been good."
The House GOP will take up a plan next week that would extend the debt limit to April 15, requiring both the House and Senate to pass budget resolutions by then.
On the economic front, consumer sentiment dipped to 71.3 in January, according to the Thomson Reuters/University of Michigan survey, falling to its lowest level since December 2011. Economists polled by Reuters expected a reading of 75.
Among earnings, Dow component General Electric rallied after the conglomerate posted results that beat estimates, thanks to growth in China and in resource-rich nations. GE is a minority owner of NBC Universal, the parent company of CNBC.
With businesses spanning multiple industries, GE's results will serve as a bellwether for other S&P 500 companies, said Art Hogan of Lazard Capital Partners.
"It's attached to so many different verticals in the S&P 500. When you have General Electric that is a pretty good window into what the rest of the S&P is doing in terms of supply and demand," Hogan said.
Morgan Stanley jumped after the banking giant swung to a profit, as earnings beat expectations on a surge in equity sales and trading, and strong margins in its wealth management business. (Read More: Stock Rally Still Has Legs: Morgan Stanley CEO)
Schlumberger rallied after the oilfield services company posted earnings that topped expectations on strong demand for oil and gas drilling services beyond North America.
So far, 66 S&P 500 firms have posted quarterly results so far this quarter, with 62 percent of earnings coming in above estimates and 67 percent topping revenue expectations, according to Thomson Reuters. (Read More: Despite Better Earnings, CEOs Worry About 'Uncertainty')
The Treasury announced plans to sell 300.1 million shares of General Motors over the next 12 to 15 months. GM repurchased 200 million shares back from the Treasury back in December.
Boeing declined after U.S. Transportation Secretary Ray LaHood said that the Boeing Co 787 Dreamliner jet will not fly again until authorities are "1,000 percent sure" it is safe. (Watch: Boeing's Problems Will Be Resolved: Analyst)
AT&T that it would take a fourth-quarter charge of about $10 billion and expects quarterly results to be pressured by high smartphone costs and damage from Hurricane Sandy. Shares initially started the session in the red, but rebounded to close higher.
Research In Motion jumped after Jefferies upgraded the BlackBerry maker to "buy" from "hold."
Economic data from China showed the economy grew at a faster-than-expected 7.9 percent in the fourth quarter, rebounding after seven straight quarters of slowdown, indicating the world's second-largest economy was recovering from its recent slowdown. Both Tokyo and Hong Kong stock markets surged to multi-month highs following the upbeat sentiment. (Read More: China's Growth Speeds Up, but for How Long?)
—By CNBC's JeeYeon Park (Follow JeeYeon on Twitter: @JeeYeonParkCNBC)
On Tap Next Week:
MONDAY: MLK Day—All markets closed, Pres. Obama inauguration
TUESDAY: Chicago Fed nat'l activity index, existing home sales, Richmond fed mfg index; Earnings from DuPont, Johnson & Johnson, Travelers, Verizon, Google, IBM, AMD, Texas Instruments
WEDNESDAY: Weekly mortgage applications, FHFA home price index; Earnings from McDonald's, United Tech, Abbott Labs, Coach, WellPoint, Amgen, Apple, F5 Networks, Netflix, Sandisk, Symantec, Western Digital
THURSDAY: Jobless claims, PMI manufacturing index flash, leading indicators, oil inventories, Fed balance sheet/money supply; Earnings from 3M, Bristol-Myers, Nokia, Xerox, AT&T, Microsoft, E-Trade, Juniper Networks, Starbucks
FRIDAY: New home sales, Geithner's last day as Treasury Secretary, House recess until Feb. 4; Earnings from P&G, Halliburton, Honeywell, Kimberly-Clark
More From CNBC.com: