This story was updated at 4:10 p.m. EDT.
Wall Street surged Monday afternoon, rebounding from a bruising week, helped by Apple Inc. and a rally in oil prices.
Apple shares rose 4 percent to $94 after Warren Buffett's Berkshire Hathaway reported a stake worth about $1 billion in the iPhone maker. The stock, which had lost about one-fifth of its value in the past month, gave the biggest boost to the three major market indexes.
Crude oil futures hit a six-month high as output disruptions were expected to cut into a long-standing glut in the market, while higher commodity prices boosted basic materials and energy shares. Factors driving the rally were growing Nigerian output disruptions and Goldman Sachs Group Inc. saying the market has ended almost two years of oversupply and flipped to a deficit.
The Dow Jones Industrial Average closed the day up 175 points, or 1 percent, at 17,711, while the broader S&P 500 was up 23 points, or 1 percent, at 2,067. The Nasdaq Composite rallied 58 points, or 1.2 percent, to 4,775.
Last week, the Dow and S&P 500 fell for a third straight week, while the Nasdaq's losing streak hit four weeks.
"The market has been shaken by the depth and breadth of the negativity coming out of the retailing stocks," said Andre Bakhos, managing director at Janlyn Capital LLC in Bernardsville, New Jersey. "The market is going to have to make an evaluation if this is going to be a one-time blip or is something that continues to bear down."
Oil majors Chevron Corp. and Exxon Mobil Corp. were up about 1 percent, providing the biggest boost to the energy sector.
Investors have been keeping a sharp eye on data for clues regarding the path of interest rates. Some Federal Reserve officials have hinted at two rate hikes this year, but traders are pricing in only one.
Gloomy quarterly reports from retailers had clouded the market last week. The retail sector is in focus again, with Target Corp., Wal-Mart Stores Inc. and Home Depot Inc. set to report results this week.
The S&P 500 is up more than 1 percent this year. While the benchmark index has risen about 14 percent since February lows, the rally fizzled out in the last few weeks amid mixed corporate earnings and economic data.
On Monday, Anacor Pharmaceuticals soared 57 percent to $101 after Pfizer Inc. said it would buy the drugmaker in a deal valued at $5.2 billion. Anacor gave one of the biggest boosts to the Nasdaq Biotechnology index, which gained some 3 percent.
Tribune Publishing Co. was up 23.4 percent at $14 after Gannett Co. raised its buyout offer to $15 per share. Gannett was up 2 percent at $16.
Data from Reuters were used to report this story.