Comcast (CMCSA) reported better-than-expected second-quarter earnings and higher sales on Wednesday as the addition of new Internet and phone customers helped offset weaknesses in its NBC Universal unit.

The Philadelphia cable provider posted operating income of $3.1 billion, or 50 cents a share, compared with a year-earlier $2.94 billion, or 37 cents, topping average analyst estimates of 47 cents in a Thomson Reuters poll.

Revenue for the three months ended June 30 was up 6.1% to $15.2 billion from $14.3 billion a year ago, matching the Street’s view. Sales were led by a 2.8% increase to $5.1 billion in video and 8.9% increase to $2.38 billion in high-speed Internet.

“Our solid operating and financial results for the second quarter underscore the strength of our cable company and our focus on driving operational excellence and technology innovations,” Comcast CEO Brian Roberts said in a statement.

The largest U.S. cable TV operator posted a 40.1% increase in video, high-speed Internet and voice customers. As of June 30, video, high-speed and voice customers totaled 50.5 million, an increase of 2.8% over last year’s second quarter.

Comcast added 156,000 high-speed Internet subscribers and 158,000 phone customers.

The gains were partially offset by declines in NBC Universal, which faced higher expenses and a flop from the “Battleship” movie. Sales in its broadcast television group fell by 9.1% to $1.7 billion and 1.8% to $1.2 billion in its filmed entertainment group.

Total revenue from NBC Universal was down a slight 0.8% during the period to $5.5 billion, also reflecting the impact on its broadcast television segment from a content licensing agreement.

Sales in NBC's cable networks group increased by 3.6% to $2.3 billion, driven by higher distribution revenue and advertising. Shares of Comcast were up about 3.4% Tuesday in the pre market.

Follow Jennifer Booton on Twitter at @Jbooton