New Chocolate Peanut Butter Cheerios are helping re-energize General Mills.

General Mills has been in a prolonged cereal slump, but customers scooped up Lucky Charms, Cinnamon Toast Crunch, Reese's Puffs and Cocoa Puffs last quarter, helping lift sales for the first time in more than two years.

The company said its new chocolate peanut butter flavored Cheerios, which hit stores in October, were a quick hit and contributed to a 7% spike in U.S. cereal sales from last year.

It's been a rough time for General Mills and other top cereal makers, including Kellogg, as consumers drift away from sugary morning staples and processed foods toward healthier choices. General Mills has slumped nearly 7% this year and Kellogg (K) is down 11%.

General Mills is trying to fight back with new cereal flavors and by marketing its health foods. Lärabar and Nature Valley boosted snack sales up 5%. That helped offset weak demand for Fiber One bars.

Related: Consumers sour on yogurt and cereal

Yet the company's yogurt division remains a weak spot. Yoplait's sales were down 11% as Chobani and Dannon continue eating up share of the yogurt market. General Mills rolled out Oui by Yoplait this year, but acknowledged Wednesday that its yogurt unit needs to improve.

Overall, revenue topped $4.2 billion, up 2% compared to the same time last year. Shares of General Mills (GIS) rose 1% on the report.

Although sales were up, its profit took a hit from lower prices and increased ad spending. Amazon and Walmart's race to slash food prices weighed on the company's earnings.

-- CNNMoney's Paul R. La Monica contributed to this story