Photo

Annie’s Homegrown, the organic food company known for its mac and cheese and earthy vibe, is joining the General Mills empire.

General Mills, whose stable of brands includes Pillsbury, Cheerios, Haagen-Dazs and Nature Valley, said on Monday that it had agreed to buy Annie’s for about $820 million in cash, in a bet on shoppers’ continued demand for natural and organic foods.

The price of $46 a share is a 51 percent premium over Annie’s 30-day average closing price as of Friday, Annie’s said. General Mills plans to finance the deal through borrowing. Analysts had speculated this summer that Annie’s could be acquired.

Shares of Annie’s shot up about 37 percent in trading after the stock market closed on Monday after closing at $33.51.

The deal shows how big food companies are willing to pay up for brands that are seen as homespun and healthful. Last year alone, Campbell Soup bought the baby food maker Plum Organics and WhiteWave, a dairy company that spun off from Dean Foods, agreed to pay $600 million for the organic produce grower Earthbound Farm.

Annie’s, whose logo is a smiling bunny, makes a line of mac and cheese products as well as pizzas, salad dressings, crackers and other snacks. The company, which was founded in 1989, went public in 2012 after being acquired by the private equity firm Solera Capital.

“Consumers know and trust Annie’s purpose-driven culture and authentic brand,” Jeff Harmening, the chief operating officer for General Mills United States retail business, said in a statement. “We believe that combining the Annie’s product portfolio and go-to-market capabilities with General Mills’ supply chain, sales and marketing resources will accelerate the growth of our organic and natural foods business.”

News of the deal sparked an immediate uproar on the Annie’s Facebook page. Fans of the company expressed dismay, noting that General Mills has opposed state-level efforts to label genetically modified foods, while Annie’s has pushed for tougher labeling requirements.

“Congrats Annie’s! You have just lost thousands of customers!” read one comment. “It’s too bad you’ve decided to merge with a big corporation who cares more about their bottom line and not the customer,” said another.

Annie’s emphasized that it would stay true to its values of healthy food and an environmentally conscious business. And it said it would continue to be based in Berkeley, Calif.

“Powerful consumer shifts toward products with simple, organic and natural ingredients from companies that share consumers’ core values show no signs of letting up,” John Foraker, the chief executive of Annie’s, said in a statement. “Partnering with a company of General Mills’ scale and resources will strengthen our position at the forefront of this trend.”

General Mills plans to initiate a tender offer within 10 business days for Annie’s shares. The deal, subject to a majority of the shares being tendered and to regulatory approval, is expected to close later this year.

JPMorgan Securities and the law firm Proskauer Rose advised Annie’s.