Novartis AG reported higher-than-expected profit last quarter as newer cancer medicines offset the aging blockbuster Entresto’s loss of sales to generic rivals.

Earnings excluding some items were unchanged at $5.94 billion in the second quarter, the company said TuesdayBloomberg Terminal, topping the $5.34 billion average estimate of analysts surveyed by Bloomberg. Sales were also better than anticipated, signaling a return to growth.