DreamWorks Animation (DWA) CEO Jeff Katzenberg got the price he wanted, and Comcast (CMCSA) - Get Comcast Corporation Class A Report  picks up a lot of family-friendly content for its movie business, video streaming channels and theme parks.

Comcast agreed to pay $41 a share for the smallest of the major Hollywood studios in a transaction that places an equity values on DreamWorks of approximately $3.8 billion, the companies said in a statement. Comcast also assumes roughly $250 million in DreamWorks debt.

The takeout price of $41 a share is a 51% premium to where the stock closed on Tuesday prior to a report in The Wall Street Journalthat Comcast, the country's largest Internet service provider, was near a deal to acquire the creator of Shrek, Kung Fu Panda, How to Train Your Dragon and the Penguins of Madagascar.

Shares of Glendale, Calif-based DreamWorks were surging 24% to $39.95.  

As part of the deal, Katzenberg, the company's controlling shareholder, will no longer be a part of the studio that he created in 1994 along with Hollywood superstars Steven Spielberg and David Geffen. Instead, the former Disney (DIS) - Get Walt Disney Company Report movie executive will become a consultant to NBCUniversal, Comcast's film and television division.

For DreamWorks shareholders, the deal is redemption for sticking with a company that struggled with a series of costly busts that forced Katzenberg to layoff nearly one-quarter of his staff in January 2015 amid a sweeping reorganization aimed at building its video streaming platform.

"Having spent the past two decades working together with our team to build DreamWorks Animation into one of the world's most beloved brands, I am proud to say that NBCUniversal is the perfect home for our company," Katzenberg said in a statemenet. "A home that will embrace the legacy of our storytelling and grow our businesses to their fullest potential."

TheStreet Recommends

Katzenberg, who holds about 60% of voting shares in DreamWorks, stands to reap more than $400 million from the transaction.

Comcast, in a filing, added that the DreamWorks acquisition is ''a great opportunity to strengthen NBCU's film animation business, build its consumer products business, expand its theme park attractions, and enhance its position in the kids TV space.'' 

Comcast plans to merge DreamWorks with its own animation studio, Illumination Entertainment, creator of the Despicable Me movies. The merger should provide DreamWorks with the stability to withstand a disappointing film release. It also provides the studio with a much larger film distribution network and the chance to leverage its franchise characters through NBCUniversal's consumer products division and theme parks, including the recently opened Universal Studios Japan.

For the deal to work financially for Comcast, it must remove a variety of costs -- estimated at $300 million -- in salaries and production. To do that, Stephen Burke, who heads NBCUniveral, said Katzenberg had to be relegated to a consultancy role in order to more aggressively integrate DreamWorks into Illumination.

Comcast's strategy is very similar to the one Disney employed when it acquired Steve Jobs' Pixar Animation Studios in 2006 for $7.4 billion. While Pixar's price tag was seen as excessive by some, Disney quickly proved naysayers wrong, extracting enormous value out of its many franchise, including Toy Story

Katzenberg is likely to focus on continuing to build digital video platforms such as tween-centric AwesomenessTV, which DreamWorks acquired for about $120 million in 2013, later selling stakes in the content creator to Hearst and Verizon (VZ) - Get Verizon Communications Inc. Report  at significant profits.

By acquiring DreamWorks, Comcast may be in a much better position to challenge Disney for supremacy in the lucrative family entertainment business. DreamWorks should also afford NBCUniversal with more content to use on its own video streaming platforms such as the millennial-focused Watchable while using the studio's extensive library that includes Casper, Lassie, Frosty the Snowman and Rudolph The Red-nosed Reindeer for a variety of children's entertainment programming.

The deal, which has been approved by the boards of both companies, is subject to anti-trust approvals in the U.S. and abroad, the companies said.