The Nasdaq briefly topped 4,000 Monday for the first time since September 2000, but failed to close above that key level.

And while the tech-heavy Nasdaq did cross a big milestone, it is still well below its peak of above 5,000, which was set in March 2000.

The Dow managed to log another record closing high though, while the S&P 500 finished in the red after hitting a new all-time high earlier in the day.

Stocks ended mixed as investors took in a disappointing report on the housing market. Pending home sales dropped 0.6% in October from the prior month. That was the fifth straight decline. Economists expected a 1.3% increase. The housing recovery has been a big boon for the stock market this year, so signs of weakness are worrisome.

Meanwhile, investors seemed encouraged by a landmark deal reached between Iran and the United States, the United Kingdom, France, Russia, China and Germany over the weekend.

As part of the agreement, world powers will relax economic sanctions against Iran in exchange for a promise that the country scales back its nuclear program. Oil prices sank on the expectation of more oil exports from Iran following the nuclear deal.

World markets also climbed on the news. European markets finished with solid gains, with Germany's benchmark Dax index leading the way. Most Asian markets ended higher, with Japan's Nikkei jumping 1.5% as the yen weakened against the dollar.

Related: Fear & Greed Index remains in Greed territory

Besides the Iran deal and pending home sales, there wasn't much other news moving markets. Trading volume is expected to be low during this holiday-shortened week and there are few economic and earnings reports on tap. U.S. markets will be closed Thursday for Thanksgiving and will shut at 1 p.m. ET on Friday.

In company news, Wal-Mart (WMT) announced that current CEO of Wal-mart International Doug McMillon will replace CEO Mike Duke, who plans to retire early next year. Shares rose and hit an all-time high.

Apple (AAPL) bought the Israeli tech company PrimeSense, a leading developer of 3D sensors. Apple's stock was up about 1%.

Yahoo (YHOO) announced that Katie Couric will join the company early next year as its "global anchor."

Social media stocks were trading lower, a sign that the hot sector may be losing momentum.

Shares of Yelp (YELP), which have more than tripled this year, were down almost 7%. Facebook (FB) shares, which have more than doubled so far in 2013, slid 3%.

Twitter (TWTR), which just debuted on the stock market earlier this month, tumbled nearly 5%. LinkedIn (LNKD), Groupon (GRPN) and Pandora (P) were also all down sharply. That put pressure on the Global X Social Media Index ETF (SOCL).

"Looks like social media bubble officially popping ... $SOCL, $FB, $LNKD, $TWTR, $P, $YELP Bearish," said StockTwits trader slowslimslider.

Another user, ACInvestorBlog, noted that the fall of some "bubble stocks" could mean that Netflix (NFLX) and Amazon (AMZN) could be next to face pressure. Netflix has surged 275% this year, while Amazon is up almost 50%.

"Some bubble stocks falling from grace $FB $TWTR $YELP $TSLA, he said. "Watch $NFLX and $AMZN."

But some traders remained bullish on Facebook. One noted that Facebook's stock has enjoyed a sharp rally to its current level of around $45.

"$FB Keep in mind wasn't too long ago 26 was norm," IncrementalWealth said. "A 50% jump in a few months. Watching for lower as said all along then back in big again. Bullish."