Comcast is in talks to buy DreamWorks Animation for more than $3 billion, a deal that could make the cable giant a rival to Walt Disney Company. Image: Comcast / Everett Collection

US entertainment and cable giant Comcast will buy DreamWorks Animation, the studio known for its Shrek and Madagascar films.

“DreamWorks will help us grow our film, television, theme parks and consumer products businesses for years to come,” Steve Burke, chief executive of Comcast unit NBCUniversal, announced overnight.

Under the $US3.8 billion ($5 billion) deal, the animation studio will become part of NBCU’s Universal Filmed Entertainment Group, which includes Universal Pictures.

The studio, which has won awards for films such as Kung Fu Panda and The Prince of Egypt, was originally part of the DreamWorks group created by Steven Spielberg, David Geffen and Jeffrey Katzenberg in the 1990s. It was spun off as a separate company in 2004.

Upon completion of the deal, Katzenberg, a former Disney executive, will become chairman of DreamWorks New Media, which will include some NBCU television operations.

“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 aims to strengthen NBCU programming for family and children in film, television and on-demand video.

It gives the group the popular film franchises such as How to Train Your Dragon and Monsters vs. Aliens.

Comcast has agreed to pay $US41 a share in the deal, which has been approved by the boards of both companies and is expected to close later this year, subject to regulatory approvals.

Comcast, which is the largest US cable TV operator, acquired a majority of NBC Universal in 2009 and in 2013 boosted its stake to 100 per cent.

That gave Comcast the large NBC television network as well as the Universal Studios in Hollywood and its theme parks.