Annie's shares spiked more than 37 percent in extended-hours trading after the announcement. General Mills shares were unchanged.
General Mills will pay $46 a share in cash to acquire the company. Annie's said the transaction consideration represents a 51 percent premium over Annie's 30-day average closing price of $30.47 as of September 5, 2014
The deal, which is expected to finalize later this year, is expected to reflected in General Mills' earnings within the first 12 months after its completion. General Mills plans to fund the acquisition through available credit.
"This acquisition will significantly expand our presence in the U.S. branded organic and natural foods industry, where sales have been growing at a 12 percent compound rate over the last 10 years," said Jeff Harmening, General Mills executive vice president and chief operating officer.
"Annie's competes in a number of attractive food categories, with particular strength in convenient meals and snacks—two of General Mills' priority platforms"
Best known for its the rabbit-shaped mac and cheese, Annie's reported $204 million in net sales during its latest fiscal year, up about 20 percent from a year earlier.
The Berkeley, Calif.-based company markets nearly 150 products and has more than 35,000 retail locations in the U.S and Canada.
Annie's said "partnering with a company of General Mills' scale and resources" will maximize value for stockholders and help it to expand into new channels and product lines.
—By CNBC's Karma Allen