CBS reported quarterly earnings and revenue that beat analysts' expectations on Monday.

Here's how the company did compared to what Wall Street expected:

EPS: $1.04 vs. 98 cents expected, according to Thomson Reuters

Overall revenue: $3.26 billion vs. $3.09 billion expected, according to Thomson Reuters

In the year-ago period, CBS reported adjusted earnings per share of 93 cents on revenue of $2.98 billion.

Entertainment revenue came in above analysts' expectations. The segment brought in $2.18 billion, above the $2.02 billion that analysts had projected according to StreetAccount.

CBS said that the better-than-expected performance was driven by strong revenue growth in affiliate and subscription fees. In the second quarter, the company saw $848 million in fee revenue. That figure represents a 38 percent year-over-year growth for the business.

CEO Les Moonves said the return of "Twin Peaks" helped boost Showtime subscriptions "dramatically."

Growth in CBS' subscription service fees has gained importance amid cord-cutting concerns and declining ad revenue. But in the second quarter, CBS saw advertising revenue grow 6 percent year over year.

Moonves said in a statement that CBS has benefited from recent "skinny bundle" deals with other providers as well as its own streaming services such as CBS All Access and Showtime. Moonves also said those in-house services are on track to hit 4 million subscribers by the end of the year.

CBS All Access will also expand globally, starting with Canada by the end of 2018, the company said in a statement.

Monday morning, AT&T and CBS announced an agreement in which CBS, as well as the CW, Showtime, CBS Sports and Pop, will be available on AT&T's DirecTV Now live streaming service.

After the earnings release, CBS shares were little changed in after-hours trading.

Shares of CBS have gained more than 23 percent over the past 12 months, but are down about 1.5 percent over the past three months.