General Mills Inc. on Wednesday reported a rise in quarterly earnings that matched a better-than-expected view the company gave earlier this month, helped by a move to reduce the size of cereal boxes and charge consumers more per ounce.

Net income was $289 million, or 81 cents per share, compared with $267 million, or 74 cents per share, a year ago.

The maker of such iconic products as Cheerios cereal, Pillsbury dough and Progresso soup said earlier this month it expected to earn 81 cents a share, including restructuring costs.

Excluding restructuring costs, Wall Street analysts, on average, expected earnings of 79 cents per share, according to Reuters Estimates.

General Mills, like many other food companies, has been spending more on marketing to help boost sales. At the same time, it has been pressured by rising costs for commodities like corn, dairy products and energy.

To help offset those costs, General Mills recently decreased the size of its cereal boxes and trimmed box prices, but not as much as it cut box size. As a result, it is now charging consumers more per ounce of cereal.

The Minneapolis-based company said sales rose 7 percent to $3.07 billion. Analysts, on average, had forecast sales of $3 billion, according to Reuters Estimates.

Operating profit rose 6 percent to $473 million.

U.S. retail segment sales rose 6 percent in the quarter, and sales of Big G cereals, which include Cheerios, Lucky Charms and Wheaties, rose 5 percent.

General Mills affirmed its fiscal year outlook for low single-digit sales growth, mid single-digit growth in segment operating results and full-year profit of $3.39 to $3.43 per share.

Analysts expect a full-year profit of $3.45 per share on revenue of $13 billion, according to Reuters Estimates.

General Mills shares closed at $58.67 Tuesday on the New York Stock Exchange. The stock has gained about 1.9 percent so far this year, compared with a rise of about 12.7 percent in shares of rival Kellogg Co.