The Walt Disney Company announced that it has entered into a definitive agreement to buy 21st Century Fox for more than $52 billion in stock.

The deal gives Disney film businesses including Twentieth Century Fox, Fox Searchlight Pictures and Fox 2000, which together are the homes of Avatar, X-Men, Fantastic Four and Deadpool. On the television side, Disney will get Twentieth Century Fox Television, FX Productions and Fox21, with shows including “The Simpsons” and “Modern Family.”

21st Century Fox shareholders will receive 0.2745 Disney shares for each share they own. The transaction also includes approximately $13.7 billion in debt.

Robert Iger will continue as chairman and CEO of The Walt Disney Co. through the end of 2021.

However, before the buyout, 21st Century Fox will separate the Fox Broadcasting network and stations, such as: Fox News Channel, Fox Business Network, FS1, FS2 and Big Ten Network. They will be placed into a newly listed company that will be spun off to its shareholders. That Rupert Murdoch and his sons were willing to sell off much of the business that has been built up over decades came as a shock to the entertainment industry.

The entertainment business is going through big changes. TV doesn’t have a monopoly on home entertainment anymore. There’s Netflix, which is spending up to $8 billion on programming next year. Amazon is building its own library, having splashed out on global TV rights to “Lord of the Rings.” Facebook, Google and Apple are also investing in video.

As consumers spend more time online, TV’s share of U.S. ad spending is shrinking. Advertisers are following consumer attention to the internet, where Google and Facebook win the vast majority of advertisers’ dollars.

“We’ve been talking about cord cutting for the better part of a decade. But now it’s real,” USC Annenberg communications professor Chris Smith said. The media companies have to compete with the internet giants for consumers’ attention — and the younger generations pay more attention to YouTube, Facebook and other “platforms” than traditional TV, Smith said.

To combat this trend, Disney is launching new ESPN- and Disney-branded streaming services over the next couple of years. It could beef them up with some of the assets it’s acquiring from Fox, making them exclusive to its services and sharpening its ability to compete with Netflix for consumer dollars.

“The core underlying driver for this deal in our opinion is the impending battle royale for content and streaming services vs. the Netflix machine,” GBH analyst Daniel Ives wrote.

Not everyone thinks this is a good bet by Disney, though. Rich Greenfield, a longtime Disney critic, thinks the deal is a bad idea that ties Disney to older TV-distribution systems — cable and satellite TV — rather than helping it look toward the future.

He also notes that regulators may not like the idea of combining two major movie studios. The Justice Department surprised many in the industry and on Wall Street when it sued to block another media megamerger, AT&T’s acquisition of Time Warner, in November.

The Associated Press contributed to this story.