(Reuters) - General Mills Inc GIS.N reported a quarterly profit above Wall Street estimates on Wednesday as the maker of Cheerios cereal raised prices and eked out higher margins from cost savings.

FILE PHOTO: General Mills cereals rest on a shelf inside of a grocery store in New York, U.S., March 20, 2017. REUTERS/Lucas Jackson

Several consumer goods companies, emboldened by a strong U.S. economy, have raised prices this year to make up for rising commodities and transportation costs. Many, like General Mills, have also been trying to cut other expenses.

General Mills shares, which have fallen about 38 percent since the start of the year, were up 6.6 percent at $39.11.

“Results were better then feared. Consumer stocks have been beaten up quite harshly in recent weeks because of continued concerns about margins and growth,” Edward Jones analyst Brittany Weissman said.

“If General Mills’ margin pressures had continued I think that would have added to worries for the industry,” Weissman said.

Adjusted gross margin was 34.5 percent for the second quarter ended Nov. 25, beating the average estimate of 33.76 percent, according to IBES data from Refinitiv. General Mills said its recent acquisition of the high-margin Blue Buffalo pet food company also drove margins.

General Mills is typically the first U.S. packaged food company to issue a quarterly report, and its results often set the tone for the rest of the industry. ConAgra Brands Inc CAG.N is scheduled to post earnings on Thursday.

“What’s changed over the last six months is we’re seeing about 2 percent price increases across the industry,” Chief Financial Officer Donal Mulligan told Reuters. Retailers have accepted higher prices because they too are seeing the same jump in costs for logistics, raw materials and labor, he said.

“We continue to have a frugal mindset in spending,” Mulligan said.

The company has been cutting costs across its supply chain - reassessing how and where it makes products as well as with what ingredients. Mulligan said the company was on track to save $450 million in expenses by the end of the fiscal year.

General Mills, which also makes Yoplait yogurts and Nature Valley granola bars, earned 85 cents per share excluding items, 4 cents above the average analyst estimate.

Net sales rose 5 percent to $4.41 billion, but missed the average estimate of $4.51 billion.

Net earnings attributable to the company fell to $343.4 million, or 57 cents per share, from $430.5 million, or 74 cents per share, a year earlier.