TreeHouse Foods Inc. (NYSE: THS)  agreed to buy ConAgra Foods Inc.’s (NYSE: CAG) private-label unit for $2.7 billion, a deal that will it the largest U.S. maker of store-brand groceries and test its ability to turn around an ailing business.

The purchase will reduce earnings per share by as much as 35 cents a share the first year after the acquisition, then add as much 70 cents a share to profit the second year, Oak Brook, Illinois-based TreeHouse said in a statement Monday. The acquisition is expected to close in the first quarter, the company said.

Other recent food deals include Kellogg Co.(NYSE: K) purchasing Mass Food Group; Post Holdings Inc. (NYSE: POST) picking up Willamette Egg Farms LLC; Snyder’s-Lance Inc. (NASDAQ: LNCE) agreeing to buy Diamond Foods Inc. (NASDAQ: DMND) for $1.27 billion

The takeover will significantly bulk up TreeHouse’s operations, expanding it to more than 50 manufacturing facilities, 16,000 employees and more than doubling its annual sales to almost $7 billion. However, TreeHouse will have to revive a business that has suffered from management missteps since ConAgra bought it from Ralcorp for about $6.7 billion in 2013. TreeHouse shares slid as much as 9 percent in New York on speculation that improving the division’s profitability will prove difficult.

"It will be a tough turnaround for TreeHouse," said Michael Halen, an analyst at Bloomberg Intelligence. "ConAgra has been losing customers due to the fact that they cut the salesforce too deeply, took pricing too bluntly, and suffered supply-chain and customer-service issues. These missteps forced ConAgra to make pricing concessions to keep customers, and that has hurt margins."

TreeHouse dropped as low as $77.83, the biggest intraday slide since May 7. The shares had been little changed this year through the end of last week. ConAgra rose as much as 2.9 percent to $41.73. The stock already had gained 12 percent this year.

TreeHouse has largely expanded through acquisition since it was spun off from Dean Foods in 2005. In those 10 years, the company has completed 13 deals with a total value of about $2.7 billion, according to data compiled by Bloomberg. TreeHouse said it will fund the ConAgra takeover with $1.8 billion in new debt and $1 billion in stock issuance.

ConAgra Chief Executive Officer Sean Connolly announced plans to seek a buyer for the private-label business in June, only three months after taking the job. The Omaha, Nebraska- based company had struggled with the business, hurt by management missteps and an overreliance on products in struggling categories. The company also had been pressured by activist investor Jana Partners, which criticized ConAgra’s handling of the unit.

Morgan Stanley and Bank of America Corp. are acting as financial advisers to TreeHouse on the transaction. Winston & Strawn is serving as legal counsel. ConAgra got financial advice from Goldman Sachs & Co. and Centerview Partners, and Davis Polk & Wardwell was its legal adviser.