(Bloomberg) -- Charter Communications Inc. shares were on pace for a record after the cable company posted a surprising gain in TV and internet customers despite the ongoing effects of the Covid-19 pandemic.

The second-largest U.S. cable operator swung to a gain of 102,000 residential video subscribers and added 842,000 residential internet customers in the second quarter. Analysts had expected it to lose 129,000 video customers while adding 439,530 new broadband subscribers.

Charter shares rose 6.5% to $600 in premarket trading at 9:01 a.m. in New York. The stock is up more than 16% this year through Thursday.

The gains are a rare bright spot in the pay-TV industry, which has seen steep subscriber declines in recent years as customers turned to popular streaming services like Netflix Inc. and Walt Disney Co.’s Hulu.

“We got much better adds than we expected (and we were well above consensus), and far more of the adds came from genuine strength in the business than from Covid-related initiatives,” Jonathan Chaplin, an analyst at New Street Research, wrote in a note Friday.

Charter’s growth is particularly notable at a time when the competition for viewers has gotten even more heated. Millions of customers have signed up for new offerings including Disney+, AT&T Inc.’s HBO Max and Comcast Corp.’s Peacock, which made its national debut July 15 and has collected more than 10 million signups since its limited launch in April.

The subscriber gains also outpaced those of its pay-TV peers. AT&T, which operates DirecTV, said last week it lost 886,000 subscribers in the second quarter. On Thursday, Comcast reported shedding 477,000 TV customers in the period.

Charter exceeded profit estimates with earnings of $3.63 a share on $11.7 billion in revenue. Analysts expected earnings of $2.46 and $11.6 billion in sales.

The company disclosed some of the financial effects of Covid-19, due to closed businesses and canceled sporting events. The disruption erased about $82 million from Charter’s bottom line and cut about $282 million off total sales, according to the company’s earnings presentation.

Charter boosted spending in the second quarter, a bit more than expected. Total capital spending was $1.88 billion, compared with analysts’ prediction of $1.62 billion. The cable shop has spent $3.34 billion on capital investment in the first half of the year and is on pace to finish below the $7.2 billion total last year. Capital spending was $9.1 billion in 2018.

©2020 Bloomberg L.P.