(Reuters) - Cheerios cereal maker General Mills Inc beat Wall Street estimates for quarterly profit and raised its full-year forecast on Wednesday, aided by price increases across a wide range of products, sending its shares to their highest in a year.

FILE PHOTO: General Mills breakfast cereal is shown for sale in Carlsbad, California, U.S., June 27, 2017. REUTERS/ Mike Blake

The packaged goods industry has been battling surging freight and commodities costs all of last year as railroads and truck fleets hike rates, forcing them to pass on the additional costs to consumers.

The burden of rising costs has been a double-whammy to the industry that has been struggling to turnaround and adapt to changing preferences as consumers move away from processed and sugary foods.

While price hikes helped overturn three quarters of declining revenue at its North America Retail business, its biggest unit, it has partly hurt consumer demand for snacks and yogurts.

Still the business brought in $2.52 billion in the quarter, benefiting from strong U.S. cereal sales, which the company called the “best category performance” in years.

“The consumers are responding to innovation as well as our marketing, we’re actually quite encouraged about the (cereal) category,” Chief Financial Officer Donal Mulligan said on a post-earnings call.

The company has also been cutting costs, changing the mix of products it sold and cashing in on its acquisition of pet food business, Blue Buffalo, to boost margins. Adjusted gross margin for the quarter rose 170 basis points to a better-than-expected 34.2 percent.

“Our year-to-date performance and fourth-quarter plans give us confidence that we will meet or exceed all of our key fiscal 2019 targets,” Chief Executive Officer Jeff Harmening said.

Upbeat results from General Mills provide a silver lining for the packaged food industry which was rattled late last month when Kraft Heinz Co posted a quarterly loss and wrote down the value of Kraft and Oscar Mayer brands.

“In the minefield of packaged food stocks lately, where big misses, disappointments have almost become the norm, General Mills’ strong third quarter, profit guidance raise and constructive tone should send the stock up by a solid amount,” J.P. Morgan analyst Ken Goldman said.

The company said it expects adjusted profit for fiscal 2019 to be between flat and 1 percent from a prior forecast range of flat to down 3 percent.

Excluding one-time items, the company earned 83 cents per share for the quarter ended Feb.24 and beat expectations of 69 cents. Its net sales rose 8 percent to $4.20 billion and was largely in line with expectations.

Shares of the company rose as much as 4.8 percent to a year high of $49.50, with a Jefferies analyst saying the results did not have much for the bears.