UPDATE 1-J.M. Smucker to buy Ainsworth Pet Nutrition for $1.7 bln

(Adds deal details, background)

April 4 (Reuters) - J. M. Smucker Co said on Wednesday it would acquire pet food and pet snacks maker Ainsworth Pet Nutrition in an all-cash transaction for about $1.7 billion to strengthen its pet food portfolio in an fast-growing pet food market.

The deal comes nearly a month after rival General Mills Inc said in February it would buy Blue Buffalo Pet Products Inc for about $8 billion.

The pet food and pet snacks market generates over $30 billion in annual retail sales in the United States, J. M. Smucker said.

The company said it expects annual cost synergies of $55 million within first three years and net sales of about $800 million in the first full year, following the deal.

J. M. Smucker also said it plans to explore options for its U.S. baking business, including a sale.

The baking business, which includes brands like Pillsbury and Martha White, is expected to generate net sales of about $370 million this fiscal year.

J.M. Smucker's shares were up 1.6 percent at $123.70 in after-market trading. (Reporting by Nivedita Balu in Bengaluru; Editing by Shounak Dasgupta)