A rally in crude prices boosted energy shares and Apple Inc. jumped after Berkshire Hathaway Inc. disclosed a stake in the iPhone maker, spurring broader gains in U.S. stocks as the S&P 500 rebounded from the longest streak of weekly losses since January.

With today’s advance, equities continued to churn following a turbulent week that saw the biggest one-day rally in two months promptly wiped out by three straight losing sessions. Commodity shares jumped Monday as crude surged 3.3 percent, while Apple posted the steepest climb since March 1 after three weeks of declines. Anacor Pharmaceuticals soared 57 percent, the most ever, after Pfizer Inc. agreed to buy the drugmaker.

The S&P 500 rose 1 percent to 2,066.66 at 4 p.m. in New York, after falling for a third straight week. The gauge topped its average price during the past 50 days after closing Friday below the level for the first time since February. The Dow Jones Industrial Average added 175.39 points, or 1 percent, to 17,710.71, its fourth move of at least 175 points in the last five days. The Nasdaq Composite Index increased 1.2 percent, boosted by Apple as well as gains in biotechnology shares.

“It was a crazy week last week with retail stocks blowing up and then retail sales overall were strong, so there’s a little bit of a bounce back,” Craig Sterling, head of U.S. equity research at Pioneer Investments in Boston, said by phone. “Earnings are over more or less and the market is searching to see what the second half of the year will look like. The price of oil and other commodities seem to be catching a bid so there’s hope there will be improvement in the industrial side of the economy.”

The CBOE Volatility Index fell 2.4 percent to 14.68, after the measure of market turmoil known as the VIX closed Friday at a one-week high. A Goldman Sachs Group Inc. basket of most shorted shares capped its biggest climb in three weeks. About 6.5 billion shares traded hands on U.S. exchanges, 12 percent below the three-month average.

The main U.S. equity benchmark slid to a one-month low on Friday as disappointing results from large retailers offset data showing the consumer remains resilient. Amid the market gyrations in the past several sessions, the S&P 500 snapped an 18-day period without a swing of more than 1 percent, the longest stretch of relative calm since December 2014.

After rallying 15 percent from a February low to a four- month high on April 20, the benchmark has struggled to regain momentum amid mixed earnings releases and lukewarm signs of an economic pickup. Meanwhile, one important support for equity prices during the bull market — corporate stock buybacks — has ebbed. Announced repurchases dropped 38 percent to $244 billion in the last four months, the biggest decline since 2009, data compiled by Birinyi Associates and Bloomberg show.

Coming amid the worst profit slump since the financial crisis, the buyback slowdown may signal companies are preserving cash as economic and political uncertainty whips up from Europe to China and in the U.S.

Meanwhile, a spate of deal activity today helped bolster fragile sentiment. In addition to Pfizer’s pact with Anacor, Terex Corp. added 10 percent after Konecranes Oyj agreed to buy one of its businesses. Yahoo! Inc. gained 2.7 percent as people familiar with the matter said Berkshire Chairman Warren Buffett is backing a group bidding for Yahoo’s Internet assets. Tribune Publishing Co. soared 23 percent as Gannett Co. raised the all- cash offer in its hostile takeover bid.