Buoyed by stronger affiliate fees and shrinking expenses, Comedy Central and MTV parent Viacom (VIA) vaulted over expectations on Thursday by generating a 56% surge in fiscal second-quarter earnings.

In the wake of the upbeat results, shares of Sumner Redstone’s media company advanced more than 2%.

Viacom said it earned $585 million, or $1.07 a share, last quarter, compared with a profit of $376 million, or 63 cents a share.

Excluding one-time items, it earned 98 cents a share, easily topping the Street’s view of 89 cents. Revenue gained 2% to $3.3 billion, matching consensus calls from analysts.

In a sign of easing expenses, operating margins expanded to 28% from 23.2%.

“Viacom continued its steady growth and delivered notably higher profitability, driven by relentless investment in our exceptional brands, and an ongoing focus on operational excellence,” CEO Philippe Dauman said in a statement. “Viacom's substantial EPS growth is the result of revenue growth, improved margins and our $10 billion stock repurchase program.”

Viacom said its media networks revenue jumped 5% to $2.19 billion thanks to higher affiliate fees that cancelled out a slide in ancillary revenue. U.S. affiliate revenue soared 15%, compared with 17% globally. Domestic ad sales inched up 1%, but worldwide ad sales were flat at $1.07 billion.

On the other hand, Viacom disclosed a 5% drop in filmed entertainment revenue to $1.17 billion amid a 19% tumble in global theatrical revenue.

Shares of Viacom were recently up 2.67% to $51.99, compared with flat trading in the broader markets.

Follow Matt Egan on Twitter @MattMEgan5