U.S. stocks closed higher Friday, for their first positive week in four, helped by a recovery in oil from multiyear lows and hopes of stimulus overseas.
The S&P 500 closed 2 percent higher, above the psychologically key 1,900 level, with energy gaining 4.3 percent to lead all sectors higher. Oil topped $32 to settle at its highest since Jan. 8. (Tweet This)
related investing news
"I think it's all about oil today," said Chris Gaffney, president at EverBank World Markets. "We were able to continue a rally in oil or at least have oil stop falling and come back up a bit. That's got equity investors dipping their toes in the market again. That and ... (European Central Bank President Mario) Draghi pulling out his 'we'll do everything to support the markets.'"
The Dow Jones industrial average closed about 210 points higher, above 16,000, with Apple and Goldman Sachs contributing the most to gains. Earlier, the Dow gained more than 250 points.
Apple jumped 5.3 percent after Piper Jaffray recommended investors buy shares ahead of next week's earnings report, saying the stock could jump 50 percent by the presumed iPhone 7 launch in September.
American Express fell 12.1 percent as the greatest weight on the Dow. The firm posted earnings that beat on both the top and bottom line, but noted the stronger dollar impacted its overall results. Amex also announced plans to cut $1 billion in costs by the end of 2017.
The Nasdaq composite outperformed, closing up more than 2.5 percent. The iShares Nasdaq Biotechnology ETF (IBB) gained 3.3 percent to end the week up 1.35 percent.
Read MoreHow much is your portfolio down? This much?
Oil settled at $32.19 a barrel, up $2.66, or 9 percent, for its biggest one-day gain since the end of August. The commodity also had its biggest weekly gain since that time, up 9.4 percent for the week. Data from Baker Hughes showed U.S. oil rigs fell by 5 this week and now total 510.
Stocks were "long overdue for a bounce. We did see Draghi deliver yesterday," said John Caruso, senior market strategist at RJO Futures.
"I think a lot of it is just price discovery. You get some wild swings when the market is trying to develop a near-term bottom," he said, adding that long-term, he's still bearish on equities.
The U.S. dollar held about half a percent higher against major world currencies, with the euro below $1.08 and the yen at 118.82 yen against the greenback.
The ECB left rates unchanged Thursday but Draghi's remarks raised expectations of more stimulus at the central bank's March meeting. Hopes of the Bank of Japan announcing more easing at their meeting next week also boosted Asian stocks overnight, with the Nikkei 225 surging 5.88 percent. The Shanghai composite closed up 1.25 percent.
The STOXX Europe 600 gained 3 percent, while the German DAX ended about 2 percent higher, both more than 2 percent higher for the week.
On Thursday, U.S. stocks ended higher but well off session highs as some recovery in oil prices and hopes ECB stimulus helped extend Wednesday's late-session recovery. The Nasdaq composite eked out a gain of 0.01 percent after spiking more than 1 percent, while the Dow Jones industrial average closed up about 115 points after earlier adding more than 250 points.
The major U.S. averages ended the week more than half a percent higher or more, with the Nasdaq composite the best performer, up nearly 2.3 percent for the week.
"I think this week's rally's (was) largely due to short covering," said Joe Sowin, head of global equity trading at Highland Capital Management, noting that since stocks hit their lows on Wednesday, beaten-down sectors such as energy and materials have led much of the recovery.
He's watching earnings reports next week to see if corporate fundamentals can support further gains in stocks.
Read MoreSkittish investors await earnings from tech giants
After closing the week with gains, U.S. stocks were still sharply lower for the year so far. As of the close Friday, the major U.S. averages were down about 6.5 percent or more for 2016 and more than 10 percent below their 52-week intraday highs, in correction territory.
"You're seeing a lot of action that's almost an overreaction to this recession fear. … . Despite whatever Draghi does or China and those recession fears grow — and the market seems to be taking oil as an indicator of that — stocks are going to get hit," said Bernie Williams, chief investment officer at USAA Investment Solutions. He noted stocks are also "a little overvalued here" and that fundamentals do not warrant concerns about a severe economic downturn.
U.S. data out Friday included the January U.S. Markit Flash Manufacturing PMI, which came in at 52.7, in expansion territory and above the final December print of 51.2.
Existing home sales in December jumped a record 14.7 percent to an annual rate of 5.46 million units, after being temporarily held back by the introduction of new mortgage disclosure rules, which had caused delays in the closing of contracts in November, the National Association of Realtors said Friday.
The Chicago Fed December National Activity Index came in at minus 0.22, versus November's negative 0.36 read.
December U.S. leading indicators fell 0.2 percent.
Treasury yields held higher, with the at 0.87 percent and the 10-year yield at 2.05 percent, as of 1:42 p.m. ET.
"Data in the real economy softened in the fourth quarter and they softened more than expected. ... (There's) an increase in the warning signs. What that means is the chance of recession in 2017 has increased," said Timothy Hopper, chief economist at TIAA-CREF.
"The base case remains that the economy, while weak, will get better, and if that's the case, the Fed resumes tightening," he said.
The Federal Reserve meets next week but is not expected to raise rates until at least June, according to CME's FedWatch tool.
"It's all a game of expectations," said Nick Raich, CEO of The Earnings Scout. "If you price in a recession and a recession doesn't come, that's positive for stocks."
General Electric reported earnings that beat by 3 cents, but revenue missed, pressured by a strong dollar and a delay in some shipments in power and renewables to 2016 from 2015. The stock closed down 1.2 percent.
Starbucks eked out a 0.2 percent gain giving softer-than-expected current quarter outlook. The coffee chain did beat estimates by 1 cent on revenue that was roughly in line.
Major U.S. Indexes
The Dow Jones industrial average closed up 210 points, or 1.33 percent, to 16,093.51, with Apple leading advancers and American Express, GE and IBM the only decliners.
The Dow gained 0.66 percent for the week, with Verizon the top performer and American Express the worst.
The closed up 37.91 points, or 2.03 percent, at 1,096.90, with energy leading all 10 sectors higher.
The index closed up 1.41 percent for the week, with telecommunications the top gainer and financials the worst performer.
The Nasdaq composite closed up 119.12 points, or 2.66 percent, at 4,591.18.
The Nasdaq gained 2.29 percent for the week.
The Dow transports closed up 1.32 percent, up 1.34 percent for the week.
The Russell 2000 gained more than 2 percent, up nearly 1.3 percent for the week.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, declined to below 22.5
About nine stocks advanced for every decliner on the New York Stock Exchange, with an exchange volume of nearly 1.2 billion and a composite volume of nearly 4.9 billion.
High-frequency trading accounted for 49 percent of January's daily trading volume of about 9.51 billion shares, according to TABB Group. During the peak levels of high-frequency trading in 2009, about 61 percent of 9.8 billion of average daily shares traded were executed by high-frequency traders.
Gold futures for February delivery settled down $1.90 at $1,096.30 an ounce.
Read MoreEarly movers: GE, CVS, AAPL, STI, COL, SLB, SBUX, AXP & more
—CNBC's Peter Schacknow and Reuters contributed to this report.
Correction: This story has been updated to reflect that the ECB rate decision was made Thursday.