J.M. Smucker (SJM) on Wednesday said it would acquire Ainsworth Pet Nutrition -- backed by celebrity chef Rachael Ray -- in a deal worth $1.9 billion. Smucker is looking to broaden its offerings in the lucrative and rapidly growing sector. Pet foods and snacks form a market with more than $30 billion in annual retail sales, Smucker said in a news release.

The all-cash transaction, which the company will fund with debt, will come to about $1.7 billion when excluding a $200 million tax benefit, and it gives Smucker a high-profile brand in Ray's Nutrish, which contributes about two-thirds of Ainsworth's revenue.

"It has been an important goal of mine to help create pet food with the same care I use when creating my recipes, as well as a brand that has been able to donate over $27 million to help animals in need," said Ray.

Get Breaking News Delivered to Your Inbox

Smucker also said it's exploring the sale of its U.S. baking unit, with brands that include Pillsbury and Hungry Jack, that accounts for about $370 million in annual sales.

The company known for the jam bearing its name initially stepped into the pet business in 2015 with a $5.8 billion purchase of Big Hearts Pet Brands.

Smucker's latest move comes almost a month after competitor General Mills (GIS) said it would pay about $8 billion to purchase Blue Buffalo Pet Products.

Smucker's shares rose 1.6 percent in after-hours trading.