Comcast Corp reported higher-than-expected quarterly earnings as it benefited from surging ad sales and signed up customers to higher-priced cable, voice and broadband packages.

Comcast's subscriber growth was also ahead of most expectations in a quarter when the company plowed resources into finishing its deal to acquire control of NBC Universal. The deal closed in late January, adding a broadcast network, cable networks like MSNBC and USA, theme parks and a movie studio to Comcast's lineup.

Shares of the largest U.S. cable company rose 3.3 percent after its earning report and an announcement that it would raise annual dividend by 19 percent and accelerate a $2.1 billion stock repurchase program.

I was impressed both in terms of customer numbers and the financials, said Thomas Eagan, an analyst with Collins Stewart. Oftentimes a company can beat estimates on customers but not financials because they will give the services away. That wasn't the case here.

Another cable company, Cablevision Systems Corp., also reported higher quarterly earnings and increased its share buyback. But that was outweighed by disappointing subscriber numbers and its shares dropped nearly 3 percent.

Comcast's earnings, meanwhile, rose to $1.02 billion, or 36 cents a share, from $955 million, or 33 cents a share, in the period a year ago. Excluding one-time items, Thomson Reuters I/B/E/S estimates that Comcast earned 34 cents a share, ahead of the 32 cents a share analysts had expected.

Comcast's revenue also surpassed expectations, rising 7 percent to $9.7 billion, it said on Wednesday.

The stronger quarterly results came partly thanks to a surge in advertising at its cable networks, which include The Golf Channel, E! and Versus. Sharply higher ad sales were widely expected after results from media companies Time Warner Inc and News Corp in recent weeks showed that the ad market recovery is in full swing.

But the results also reflect Comcast's concentration on upgrading customers to more expensive combinations of services, such as broadband and cable. Average revenue it earned for each video customer rose by 10.6 percent in the quarter.

In the quarter, Comcast added 292,000 high-speed Internet customers, up 18 percent from a year before, and 257,000 voice customers, up about 6 percent. Those figures were ahead of what most analysts expected.

As for basic cable, the least expensive service, Comcast lost 135,000 customers. While still painful, analysts pointed out that the figure is a solid improvement from a year ago, when Comcast lost 199,000 basic cable customers.

I would say one of the standout numbers was basic video losses, said Collins Stewart's Eagan.

Comcast is hardly alone. Across the cable industry, providers have been steadily losing basic video subscribers, for any number of reasons.

Some point to economic factors, with high unemployment and a bad housing market reason enough for the hardest hit Americans to shut off cable service. Others talk about intense competition from satellite and telecommunication company rivals, such as DirecTV or AT&T Inc.

Still others say customers have canceled basic cable service because they see it as unnecessary in a day when so much programing is free on the Internet.

This quarter, Cablevision's basic cable losses were particularly alarming, analysts said. The New York based cable provider lost 35,000 basic cable customers -- more than double the 14,000 analysts at Bernstein Research had estimated.

Cablevision blamed a 15-day blackout of News Corp's Fox broadcast channel over fee dispute for losing more subscribers than expected.

Cablevision's profit rose to $113.9 million, or 38 cents a share, from $78.4 million, or 26 cents a share a year before. Revenue rose 5.7 percent to $1.87 billion.

In early trade, Comcast's shares rose 81 cents at $24.97 and Cablevision's shares fell 98 cents to $36.39.

(Additional reporting by Yinka Adegoke, editing by Dave Zimmerman and Derek Caney)