The Dow Jones industrial average edged up 18.82 points, or 0.1 percent, to 16,943.10, while the Nasdaq composite index gained 14.84 points, or 0.3 percent, to 4,336.24.
The S&P 500 has been on a steady climb for three weeks, lifting the benchmark for most investment funds by 4 percent the last month.
Judging by some measures, that sudden success makes it look like the S&P 500 has moved "too far, too fast," said Joe Bell, senior equity analyst at Schaeffer's Investment Research.
But there are still plenty of traders making bets against the market. People have also taken billions out of mutual funds that invest in U.S. stocks week after week, according to the Investment Company Institute.
"We don't think there's an overwhelming amount of optimism right now," Bell said.
In corporate deal news, Hillshire Brands rose $3.14, or 5 percent, to $62.06 after Tyson Foods emerged as the winner in a bidding war for meat processor.
Merck announced a deal to buy Idenix Pharmaceuticals for $3.85 billion, an acquisition that would give the pharmaceutical giant Idenix's array of treatments for hepatitis C. Idenix soared $16.56, or 229 percent, to $23.79.
Apple's stock rose $1.48 cents, or nearly 2 percent, to $93.77. That's after closing at $645.57 on Friday. The difference reflects Apple's 7-for-1 stock split, which gave every Apple stockholder six additional shares for every share they owned
In a disclosure filed to regulators late Friday, Carl Icahn said he and his affiliates have picked up a 9 percent stake in Family Dollar, a discount store, and plan to look for changes to boost the company's value. Family Dollar's stock jumped $8.09, or 13 percent, to $68.62.
Some investment analysts have been warning that the market is past due for a 10 percent drop, known as a "correction," because there hasn't been one since August 2011 nearly three years. Since World War II, corrections typically hit every 18 months on average, according to S&P Capital IQ.
Jim Paulsen, the chief investment strategist at Wells Capital Management, said he wouldn't rule one out this year. But such a downturn requires the right environment, one in which investors get too greedy for their own good. Right now, he said, there's too much caution.
"It's going to take some time before people get so greedy that they're going to do stupid stuff and blow us up," Paulsen said.
In the market for U.S. government bonds, the yield on the 10-year Treasury edged up to 2.60 percent from 2.59 percent late Friday. Yields rise when bond prices fall. The price of oil rose $1.75 to $104.41 a barrel.