Comcast subsidiary NBCUniversal announced Thursday it had closed a deal to purchase DreamWorks Animation in a deal valuing the film studio at $3.8 billion.

According to the Hollywood Reporter, the studio behind such animated hits as Shrek and How to Train Your Dragon will be folded into Universal Filmed Entertainment Group, which is currently headed by Jeff Shell.

Jeffrey Katzenberg, founder and CEO of DreamWorks Animation, will shift to a consultant role at NBCUniversal and will serve as chairman of DreamWorks New Media.

“DreamWorks Animation is a great addition to NBCUniversal,” NBCU CEO Steve Burke said in a statement. “Jeffrey Katzenberg and the DreamWorks organization have created a dynamic film brand and a deep library of intellectual property.”

“DreamWorks will help us grow our film, television, theme parks and consumer products businesses for years to come,” he added.

In his own statement, Katzenberg said the deal “not only delivers significant value for our shareholders, but also supports NBCUniversal’s growing family entertainment business.”

“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; a home that will embrace the legacy of our storytelling and grow our businesses to their fullest potential,” Katzenberg said.

The deal ends DreamWorks Animation’s years-long and often frustrating search for a prospective buyer. The studio had been in negotiations to sell to toymaker Hasbro in 2014 before the deal was derailed by a media leak. Before that, the studio saw a $3.4 billion sale to Japan’s SoftBank fall through.

The deal with NBCUniversal is reportedly set to close by the end of 2016. If the purchase fails to happen for any reason, DreamWorks Animation is entitled to a $200 million payout from the company.

DreamWorks Animation most recently released the well-received Kung Fu Panda 3, and has plans to roll out Trolls, The Croods 2 and How to Train Your Dragon 3 through 2018.

 

Follow Daniel Nussbaum on Twitter: @dznussbaum