Media stocks shined on Tuesday as investor sentiment was lifted by the prospects of dealmaking within the sector.
Shares of Discovery Communications jumped 1.3 percent and were among the best performers on the S&P 500. CBS shares, meanwhile, rose 1.14 percent. Disney's stock also finished higher, advancing 1 percent; it was also the best-performing stock on the Dow Jones industrial average.
Dealmaking hopes were stoked by news that Disney approached 21st Century Fox on a deal. The two companies have been in talks in recent weeks, but there is no certainty that a deal will get done. The two stocks rose on Monday and are up for a second straight day.
If the deal were to happen, it would be a "dream come true," according to Laura Martin, senior analyst at Needham.
"Putting these assets under Disney's hands will make them a lot more money," Martin told CNBC's "Power Lunch" on Monday. "At the end of the day, Fox will get more money than it could have by it operating those businesses and Disney will make more at the outset."
While the media sector rose, the broader market posted a mixed session.
The Dow Jones industrial average rose 8.81 points to 23,557.23, eking out a record closing high. The S&P 500 finished just below breakeven at 2,590.64. The Nasdaq composite, meanwhile, fell 0.4 percent to close at 6,767.78. The three indexes hit intraday record highs earlier in the session.
"Breadth has faltered recently, but breakouts continue to outnumber breakdowns supporting a year-end rally," said Katie Stockton, chief technical strategist at BTIG, in a note. "Before the target from May's breakout (~2640 for the SPX) is reached, we continue to believe a pullback will present a better buying opportunity."
Still, the major averages have had a banner year, rising more than 15 percent to all-time highs.
"There's a bit of digesting going on but there's not much indigestion," said Bruce McCain, chief investment strategist at Key Private Bank. "This market has been impervious to almost everything that's been thrown its way."
But the market's rally can be traced back to just after the U.S. presidential election last year. Since Nov. 8, 2016, the indexes are up at least 20 percent.
"The question now most likely on investors' minds is: 'How long will this ride last?'" said Sam Stovall, chief investment strategist at CFRA Research in a note Monday. "History suggests longer than we would expect. On average, the S&P 500 continued sailing along for another year after the conclusion of a president's first year since being elected before slipping into a new decline of 10% or more."
Strong corporate earnings, along with improving economic data and the prospects of changes to the U.S. tax code, have helped stocks climb higher since President Donald Trump was elected.
In the first and second quarter of the year, S&P 500 earnings grew 15.5 percent and 10.8 percent, respectively. The current earnings season has been a strong one, too. According to FactSet, third-quarter earnings have grown 6.3 percent on a year-over-year basis.
On the tax-reform front, the House released last week a bill aimed at overhauling the U.S. tax code. Among the biggest changes would be permanently lowering the corporate tax rate to 20 percent from 35 percent.