Comcast Corp. finished a challenging 2020 with $3.4 billion in fourth-quarter profits, an improvement of 6.9% from a year earlier despite headwinds from the pandemic.

The Philadelphia cable and media giant reported strong subscriber gains in its broadband business Thursday, signing up 538,000 internet customers during the quarter. But the coronavirus continued to crush its theme parks and harm film studios, dragging down revenues at NBCUniversal.

Comcast’s overall revenue during the quarter was $27.7 billion, down 2.4% from the same period in 2019. The company ended the year with $103.6 billion in annual revenue, a 4.9% drop from the previous year. Comcast made $10.5 billion in profits in 2020, a decrease of 19.3% from 2019.

The company’s shares closed at $51.60, up $3.18 (6.57%).

“With the vaccines rolling out throughout the world, we are optimistic that the parts of our business that had been most impacted will soon be back on a path towards growth,” Comcast CEO and chairman Brian Roberts said in a statement.

The company’s broadband business boomed before the pandemic, but it has benefited from consumers working and studying from home, too. Comcast’s cable unit added a record 1.6 million customers in 2020, boosting the division’s annual revenues by 3.4% to $60 billion. Fourth-quarter cable revenues rose 6.3% to $15.7 billion.

“The simple fact is that broadband results have been so good in 2020 that 2021 can’t possibly meet the same standard,” analyst Craig Moffett, of the New York research firm MoffettNathanson, wrote in a note to clients after Comcast’s earnings call. “Comcast’s blowout fourth quarter broadband growth put an exclamation point on what was already a year for the record books.”

Consumers continued to flee pay TV for cheaper online streaming. The cable company lost 248,000 video customers during the quarter and 1.4 million in 2020. But Comcast has embraced streaming, offering free Flex streaming devices to internet-only customers and bundling its services with Peacock, NBCUniversal’s streaming platform. Peacock has 33 million sign-ups since soft-launching in April.

But NBCUniversal’s hard year continued in the fourth quarter, when revenues fell 18.1% to $7.5 billion. Its annual revenues dropped 17.3% to $28 billion, as it saw declines across theme parks, film studios, broadcast television, and cable channels.

The coronavirus hit theme parks the hardest, as government restrictions kept its California park closed and reduced capacity at others. Theme park revenue plummeted to $1.8 billion in 2020, a 69% decrease from the $5.9 billion in 2019. In the fourth quarter, theme park revenue declined 63%, but Roberts said theme parks in Orlando and Osaka, Japan broke even.

NBCUniversal’s film business was also harmed by coronavirus closures, driving down revenue by 8.3% to $1.4 billion in the fourth quarter. The company said theatrical revenue plunged 70%, primarily due to movie theaters closing their doors. But the lower revenue was more than offset by a drop in operating costs, as the company spent less on marketing with fewer movies released.

The temporary drags on theme parks and film studios were not as bad as might have been feared, Moffett wrote. “Taken together, the picture is clearly better than anticipated. Comcast beat on virtually every important metric,” he said.

Sky, the U.K.-based pay-TV provider, saw fourth-quarter revenues rise 3.3% to $5.2 billion. Sky gained 244,000 customers during the quarter after many sports fans paused subscriptions earlier in the year when government lockdowns cancelled live games. Sky finished the year with revenues down 3.3% to $18.6 billion, and its customer base has nearly returned to pre-pandemic levels.