Comcast, the country's biggest cable provider, is buying DreamWorks Animation, the studio behind hit movies such as "Shrek" and "Kung Fu Panda," in a $3.8 billion deal that reinforces Comcast's position as a media and entertainment powerhouse.

The deal will see Comcast's NBCUniversal paying $41 per share of DreamWorks. The combined company would control vast franchises from DreamWorks including "Madagascar" and "How to Train Your Dragon," as well as more classic properties such as "Where's Waldo?" NBCUniversal, meanwhile, has produced some of the most successful movies over the past few years, including the "Fast and Furious" franchise, "Minions," and "Jurassic World" — a string of hits rivaled only by Disney, which owns Pixar.

The marriage between NBCU and DreamWorks has already been approved by the boards of both companies, Comcast said Thursday, and is expected to close upon approval from regulators later this year. Comcast recently made a bid to buy Time Warner Cable but was blocked by regulators last year.

Under the deal, DreamWorks chief executive Jeffrey Katzenberg will become chairman of DreamWorks Animation New Media — a role that will also involve oversight of NBCU's stakes in Awesomeness TV and NOVA.

"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," said Katzenberg in a release.

One important reason for the tie-up is DreamWorks's potential contribution to NBCUniversal's sprawling business in theme parks and consumer products, analysts say. The animation company's intellectual property could be used to create new toys and in-person experiences for children.

"You and Shrek can learn to Train Your Dragon together right after you leave the Harry Potter ride!" wrote MoffettNathanson analyst Craig Moffett in a research note Wednesday.

Comcast reported this week that first-quarter revenues from its theme park business were up more than 50 percent compared to the same quarter a year ago.

Other analysts questioned the wisdom of buying a company that has relied largely on sequels and a push to pricey 3D-movie ticket sales to drive its success.

"DreamWorks Animation has always been looking for a way to ensure its movies perform versus simply making great movies," wrote BTIG analyst Rich Greenfield in a note, adding that the firm owns relatively few "iconic" characters. "Nobody is walking around in Turbo costumes the way they walk around in Minions costumes and nobody is singing Croods songs the way they sing Frozen songs."

Still, the NBCU-DreamWorks deal reflects more of Comcast's ongoing strategy to control both substantial troves of content and the distribution pipes — Internet access and television — designed to feed that content to consumers. Comcast's previous acquisition target, Time Warner Cable, was aimed at strengthening the distribution side of that equation. Regulators moved to block that deal last year, arguing the combined company would have too much power to influence its rivals in the content business.

Similar questions arose when Comcast bought NBCU in 2011, but the acquisition was allowed to continue after Comcast agreed to a series of conditions imposed by regulators.

Antitrust experts say there is little evidence the DreamWorks deal will harm direct competition in media and entertainment, but regulators will likely be on the lookout for hints that Comcast could use its newfound power to hurt new online streaming video firms.