DreamWorks stockholders will receive $41 for each share they own. That's a 24 percent premium to the company's Wednesday closing price of $32.20. The companies put the deal's value at about $3.8 billion.
DreamWorks will become part of the Universal Filmed Entertainment Group, which includes Universal Pictures.
Once the deal closes, DreamWorks co-founder and CEO Jeffrey Katzenberg will become chairman of DreamWorks New Media. He'll also serve as a consultant to NBCUniversal, a unit of Comcast Corp.
"DreamWorks will help us grow our film, television, theme parks and consumer products businesses for years to come," Steve Burke, CEO of NBCUniversal, said in a statement.
Both companies' boards have approved the transaction, which is targeted to close by year's end.
Shares of DreamWorks surged $7.78, or 24 percent, to $39.99 a share, while Comcast's stock slipped 26 cents, or 0.4 percent, to $61.04, in early morning trade.