General Mills is moving into the pet food business with a deal to buy Blue Buffalo Pet Products for roughly $8 billion in cash.

General Mills' offer price of $40 per Blue Buffalo share represents a premium of 17.2 percent to Blue Buffalo's closing price on Thursday. Blue Buffalo's shares surged more than 16 percent on Friday morning, while General Mills shares fell 3.5 percent.

General Mills said it expects to finance the transaction with debt and cash on hand, along with about $1 billion in equity. The company expects the deal to close by the end of 2018.

The deal gives the Betty Crocker owner a path into the quickly growing pet food category, as sales of traditional packaged foods continue to slow. For Blue Buffalo, it gives a stronger distribution foothold to big box retailers — outlets the pet food maker only began to explore last year, when it began selling in stores like Target.

Pet food and care remains a point of growth in the consumer industry. In 2017, consumers spent $20 billion on pet care, $10 billion of which was on dog food, according to Nielsen.

The booming business of pet care has attracted investment from traditional consumer companies, including those that want to fortify their pet business and those like General Mills that want to jump into it fresh.

M&M-owner Mars has been building its pet business, which includes the Iams, Pedigree and Whiskas brands, to help compensate for slowing confectionery sales. It has aggressively bulked up the business, including its 2017 acquisition of animal hospital company VCA Inc. for $9.1 billion. Jam-owner J.M. Smucker bought Big Heart Pet Brands for roughly $6 billion in 2015, marking its entrance into the pet industry.

Manufacturing food for pets and humans requires similar equipment, so it is not hard for a traditional food company to move into the space, industry experts say.

General Mill's plans to acquire Blue Buffalo come as all traditional food companies are on alert about a prowling 3G Capital, the backer of Kraft-Heinz, known for its ferocious appetite to acquire food companies and its ruthless cost-cutting approach once it owns them. The ketchup giant recently suggested it may be ready for its next acquisition, and General Mills has been identified as a logical target.

It also comes as Big Food is progressively moving away from its bolt-on acquisitions of small, growth companies in favor of bolder deals that can make a more immediate impact. Large food companies have struggled to grow small brands, and the pressure from lagging food sales and constrained retailers has continued to intensify.

The deal is expected to be neutral to the company's cash earnings per share in fiscal year 2019 and will add to earnings in fiscal year 2020.