By Ragini Mathur and Avinash P

The S&P 500 and the Nasdaq rose on Monday as chip stocks rebounded, with Broadcom advancing after extending its partnership with Apple, while investors looked ahead to the start of the second-quarter earnings season.

The Dow DJ:DJI briefly hit a fresh intraday record early in the session before reversing course. The blue-chip index posted a record closing high on Thursday.

Broadcom NASDAQ:AVGO climbed 4% after the chipmaker and Apple NASDAQ:AAPL agreed to extend their deal through 2031 to develop and supply a range of custom chips.

The S&P 500 information technology sector SP:S5INFT rose 1.9%, while the Philadelphia SE Semiconductor index NASDAQ:SOX was up 3.8%, recovering after two straight sessions of losses.

South Korean chipmaker SK Hynix KRX:000660 is set to debut on the Nasdaq later this week.

In economic data, the Institute for Supply Management said its non-manufacturing purchasing managers index edged down to 54.0 last month, matching expectations.

At 12:17 p.m. ET, the Dow Jones Industrial Average DJ:DJI fell 58.93 points, or 0.11%, to 52,841.14, the S&P 500 CBOE:SPX rose 52.99 points, or 0.71%, to 7,536.23, and the Nasdaq Composite TVC:IXIC gained 361.98 points, or 1.40%, to 26,194.77.

The three major indexes each rose about 2% last week, even as semiconductor shares remained volatile after driving much of this year's market rally.

Markets have taken the recent strength in healthcare, industrials and financials as a sign the rally may be broadening beyond the chip and AI trade.

"The everything trade is still alive and well. I do think sectors that were left for dead during the Iran war are going to continue to outperform and get bids," said Thomas Hayes, chairman at Great Hill Capital LLC.

As the second-quarter earnings gather pace later this month, they will pose another test for markets. Delta Air Lines NYSE:DAL and PepsiCo NASDAQ:PEP are expected to report results later in the week.

Microsoft shares fell 1.6% after the company said it is cutting about 2.1% of its workforce, or roughly 4,800 jobs.

"What the market is saying is Microsoft can't afford all of its CapEx and there's not a clear return on invested capital yet. Therefore, laying off people in lieu of moderating CapEx spend is perceived as a negative," said Hayes.

Investors slightly eased bets on an interest-rate hike from the U.S. Federal Reserve later this year after a cooler-than-expected jobs report last week.

Traders now see a 23% chance of a 25-basis-point rate hike at the central bank's July 29 meeting, down from about 30% a week earlier, according to CME's FedWatch tool.

Hawkish bets had risen after last month's Fed meeting, the first under new Chair Kevin Warsh. The minutes are due on Wednesday.

Fed Governor Christopher Waller said on Monday forward guidance can be a "valuable tool" that speeds up the impact of monetary policy under the right circumstances, but can become problematic when used inflexibly.

Shares of O'Reilly Automotive NASDAQ:ORLY declined 6.5%. Bloomberg News reported on Thursday that the auto parts retailer sent a cash offer to buy Genuine Parts NYSE:GPC, which fell 3.5%.

SpaceX NASDAQ:SPCX was down 0.3%. Elon Musk's rocket and AI giant is set to join the tech-heavy Nasdaq 100 on Tuesday.

Advancing issues outnumbered decliners by a 1.57-to-1 ratio on the NYSE and by a 1.52-to-1 ratio on the Nasdaq.

The S&P 500 and the Nasdaq Composite posted no new 52-week highs and no new lows.