General Mills Inc. closed the books on its biggest year ever, selling $18.1 billion worth of cereals, yogurt and other packaged foods and beating expectations for its latest quarter.

But the boost that it got when the coronavirus pandemic shuttered society and led many consumers to eat more often at home is already ending, its results showed Wednesday.

Details of the recent corporate restructuring show what leaders think it will take in the future to maintain momentum.

"The rapid growth in e-commerce, the likelihood that many office workers will have some degree of remote work and the increased appreciation consumers have gained for cooking and baking over the past 18 months will have lasting impacts and will create opportunity," said Chief Executive Jeff Harmening. "Simply put, we are ending one period of significant consumer disruption only to start another."

He said General Mills will place more focus on potential acquisition targets and collecting and analyzing consumers' data to drive digital sales.

But as it returns to a slower growth environment, General Mills had to trim parts of the organization to be able to invest heavily in these areas. That meant layoffs, first reported by the Star Tribune, at the headquarters and other locations around the U.S.

Director-level executives were the first to go in May. Last week, employees in mid-level management and lower were told whether or not they'd be retained. Between 700 and 800 U.S. and Canada workers were laid off, with the company taking a $170 million charge in the latest quarter to account for severance costs.

Another 500 to 600 positions will be cut outside North America later this year.

"This change is not simply a cost-cutting exercise," Harmening said. The corporate restructure was needed to "ensure we can deliver on the consumer behavior changes that were established or accelerated during the pandemic."

While it earned $416 million in the quarter ending May 31, that and nearly every other financial metric was lower against the same period last year when pantry stocking was at its peak.

At that time, General Mills saw a 21% jump in sales, a stunning and momentary jolt to a firm accustomed to single-digit changes. Against that result, the company this spring experienced a 10% decline in sales to $4.5 billion, a level that still beat expectations and was 4% higher than the spring quarter of 2019.

Executives said they expect at-home food consumption to be higher over the next year than it was before the pandemic. About 85% of General Mills' food items cater to at-home eating while just 15% is sold into food service establishments, including schools and restaurants.

General Mills also surpassed consensus estimates with adjusted diluted earnings per share of 91 cents. It earned $1.10 a share in the same period a year ago.

General Mills stock closed up 1.5% on Wednesday.