Consumer and household goods companies led the market higher, offsetting losses by industrial and energy stocks.
A batch of corporate deal news also helped put investors in a buying mood. Mattel soared nearly 21 percent on a report that Hasbro offered to buy the rival toymaker.
General Electric slumped about 7 percent after cutting its dividend and releasing a weak forecast for next year.
The Standard & Poor’s 500 index rose 2.54 points, or 0.1 percent, to 2,584.84. The Dow Jones industrial average gained 17.49 points, or 0.1 percent, to 23,439.70. The Nasdaq composite added 6.66 points, or 0.1 percent, to 6,757.60.
The Russell 2000 index of smaller-company stocks dipped 0.21 points, or 0.01 percent, to 1,475.07. More stocks fell than rose on the New York Stock Exchange.
Bond prices were little changed. The yield on the 10-year Treasury note held at 2.40 percent.
The gains in consumer stocks and utilities, which also rose, suggest that investors were looking for yield, said Lindsey Bell, investment strategist at CFRA Research.
“They’re maybe showing a little bit of skepticism in the bull market that’s more than eight years old,” she said. “Maybe they’re feeling a little bit squeamish after last week.”
The stock market snapped an eight-week string of gains last week.
The major stock indexes opened lower on Monday and then wavered between small gains and losses. By midmorning they had inched back up into positive territory, hovering just above their Friday closing levels for the rest of the day.
Consumer and household goods companies were among the big gainers Monday. J. M. Smucker rose $2.37, or 2.3 percent, to $106.49.
While trading was mostly subdued, investors bid up shares in companies at the center of merger-related news.
Toymaker Mattel soared 20.7 percent following a report that rival Hasbro made an offer to buy the company. Mattel was the biggest gainer in the S&P 500, climbing $3.02 to $17.64. Hasbro added $5.39, or 5.9 percent, to $96.84.
Mall owner GGP jumped 8.3 percent after Brookfield Property Partners offered to buy the rest of the company for $14 billion, or $23 a share. Shares in GGP rose $1.85 to $24.05.
Traders also sent shares in Qualcomm 3 percent higher after the company rejected an unsolicited takeover offer from Broadcom worth $103 billion, or $70 a share. Qualcomm said the proposal was significantly undervalued and that a tie-up between the massive chipmakers would face substantial regulatory resistance. Shares in Qualcomm added $1.92 to $66.49. Broadcom rose 5 cents to $265.01.
Some corporate deals failed to put investors in a buying mood.
WisdomTree Investments fell 5.5 percent after the asset management company said it will pay $611 million to buy a European division of ETF Securities. Shares in WisdomTree shed 66 cents to $11.28.
General Electric tumbled 7.2 percent after the company said it would slash its dividend in half to 12 cents per share, starting next month. The company also released annual profit projections that were well below what Wall Street had been expecting.
Chairman and CEO John Flannery, speaking to investors gathered in Boston, said the cost-cutting maneuver was part of the measures GE will undertake to make the company simpler and stronger. The stock was the biggest decliner in the S&P 500, losing $1.47 to $19.02. GE is down just under 40 percent this year.
The slide in GE weighed on the industrials sector. GE accounts for about 8 percent of the sector’s market capitalization.
Traders also had their eye on the latest company earnings Monday.
Tyson Foods rose 2 percent after the meat producer posted a larger profit and greater sales than analysts had expected. The stock added $1.45 to $75.59.
Energy futures closed mostly lower.
Benchmark U.S. crude rose 2 cents to settle at $56.76 per barrel on the New York Mercantile Exchange.
Brent crude, used to price international oils, slipped 36 cents to close at $63.16 a barrel in London.
In other energy trading, wholesale gasoline gave up 2 cents to $1.79 a gallon. Heating oil was little changed at $1.93 a gallon. Natural gas fell 5 cents to $3.17 per 1,000 cubic feet.
Stocks in the S&P 500’s energy sector declined the most. Newfield Exploration slid $1.22, or 3.7 percent, to $32.09.
Gold rose $4.70 to $1,278.90 an ounce. Silver added 18 cents to $16.05 an ounce. Copper gained 4 cents to $3.12 a pound.
The dollar rose to 113.57 yen from 113.54 yen on Friday. The euro strengthened to $1.1667 from $1.1618.
The pound slid to $1.3114 from $1.3126 as investors worried that British Prime Minister Theresa May is facing a rebellion within her own party over the handling of the Brexit talks.
Major stock indexes in Europe closed lower. Germany’s DAX shed 0.4 percent, while France’s CAC 40 fell 0.7 percent. London’s FTSE 100 slid 0.2 percent.
Earlier in Asia, Tokyo’s Nikkei 225 fell 1.3 percent, while Hong Kong’s Hang Seng gained 0.2 percent.
Seoul’s Kospi slid 0.5 percent. Sydney’s S&P-ASX 200 fell 0.1 percent. India’s Sensex lost 0.4 percent.
Benchmarks in New Zealand and Jakarta rose, while Taiwan and Singapore declined.