U.S. stocks climbed Monday, pushing benchmark indexes to records, after Internet and small-cap shares rallied amid deal activity that boosted confidence in the world’s largest economy. Inc. and TripAdvisor Inc. jumped at least 5.8 percent as all 41 members in the Dow Jones Internet Index rose. The gauge surged 3 percent after last week plunging 3.6 percent. 21st Century Fox Inc. jumped 3.1 percent after reports that Rupert Murdoch’s British Sky Broadcasting Group Plc is in talks to buy European pay TV assets from Fox. Pinnacle Foods Inc. surged 13 percent after Hillshire Brands Co. agreed to buy it for about $6.6 billion including debt.

The Standard & Poor’s 500 Index rose 1 percent to 1,896.65, rising above its record from April 2. The Dow Jones industrial average added 112.13 points, or 0.7 percent, to 16,695.47, extending an all-time high.

The Nasdaq Composite Index closed at 4,143.86, surging 1.8 percent, the most since January, to trim its decline this year to 0.8 percent.

About 5.7 billion shares changed hands on U.S. exchanges, 13 percent below the three-month average.

“The global economy is accelerating, central banks are dovish, companies are making acquisitions, and it’s hard to see what could keep the market down from here,” said Allan von Mehren, chief analyst at Danske Bank A/S in Copenhagen.

The S&P 500 has rallied 4.5 percent from an April 11 low, recovering all of its losses after a selloff in technology and small-cap stocks that overshadowed optimism about the strength of the economy. Tech shares in the index jumped 1.5 percent Monday.

While the Nasdaq has recovered 3.6 percent from its April low, it remains 4.9 percent below a 13-year high in March. Netflix Inc., which fell as much as 31 percent from its record two months ago, rallied 5.1 percent Monday.

Twitter Inc. added 5.9 percent after falling 18 percent last week, the most since its initial public offering in November. Facebook Inc. rose 4.5 percent following a 5.3 percent drop last week. Yahoo Inc. gained 2 percent after slumping 8.4 percent last week, the most since September 2011.

“We’re seeing a little bit of a bounce back from some of the stocks that got hit the most over the last couple weeks,” Terry Morris, a senior equity manager who helps oversee about $2.8 billion at Wyomissing, Pa.-based National Penn Investors Trust Co., said in a phone interview.

“We’ve had a big divergence between large cap versus small cap, and growth versus value. If you look at the Russell 2000 and some of the technology or Internet-related stocks, they’ve really taken a pounding.”

Retailers including Macy’s Inc., Kohl’s Corp. and Nordstrom Inc. are among companies scheduled to disclose results this week.

Eight of the 10 main S&P 500 groups advanced Monday.

Producers of raw materials rallied 1.3 percent to pace gains, as Alcoa Inc. gained 4.2 percent.

United Technologies Corp. and General Electric Co. rose at least 1.4 percent as industrial shares advanced.