J.M. Smucker Co., the maker of jam, coffee and other packaged foods, agreed to acquire Big Heart Pet Brands for about $3.2 billion, gaining a roster of brands that includes Meow Mix, Milk-Bone and Kibbles ’n Bits.

The cash-and-stock deal will bring $225 million in one-time costs, including $150 million in cash expenses, Smucker said Tuesday in a statement. It’s slated to close in Smucker’s current fiscal year, which ends on April 30.

The Big Heart acquisition thrusts Smucker into the pet-food market, which it pegs at a $21 billion-a-year industry. Big Heart, backed by Kohlberg Kravis Roberts & Co. and other investors, was known as Del Monte Corp. before the sale of its fruit and vegetable products last year. Including $2.6 billion in debt, Tuesday’s deal is valued at about $5.8 billion.

“With approximately two-thirds of U.S. households having at least one family pet, we will now be able to serve the mealtime and snacking needs of the whole family,” Richard Smucker, chief executive officer of the Orville, Ohio-based jam maker, said in the statement.

Investors cheered the deal, sending shares of Smucker up as much as 6.7 percent to $113 in late trading. The stock had dropped 2.6 percent last year, trailing the 11 percent gain of the Standard & Poor’s 500 Index.

The purchase represents the second multibillion-dollar pet- food deal in the past year. In April, Procter & Gamble Co. agreed to sell about 80 percent of its Iams, Natura and Eukanuba business to Mars Inc. for $2.9 billion. Five months later, it announced plans to sell the remainder of the unit to Spectrum Brands Holdings Inc. for an undisclosed amount.

Dave West, the CEO of San Francisco-based Big Heart, will lead Smucker’s new pet-food division. The business has almost 2,500 employees, with annual sales of about $2.3 billion and adjusted earnings of $450 million.

William Blair & Co. served as financial adviser to Smucker on Tuesday’s deal, while Wachtell, Lipton, Rosen & Katz provided legal counsel. Bank of America Corp. provided financing for the transaction.

The merger unites a wide range of animal and human food brands. Smucker’s portfolio includes household names such as Folgers, Jif, Crisco and Hungry Jack. Big Heart, seen as a market leader in the “pet snacks” category, sells 9Lives, Pup- Peroni and Gravy Train.

Other pet-related acquisitions have come from Whistle Labs, which bought Tagg in January, and the Riverside Co.'s investment in Bionic Pet Products, also in January.