NEW YORK — The Walt Disney Co., an entertainment firm as sprawling as one of its landmark theme parks, has reached a deal to pull off one of the largest media mergers in history by acquiring the majority of assets from rival 21st Century Fox.

The announcement resets the Hollywood power grid. Disney, the nation's largest studio by box-office returns and the company behind the Marvel and Star Wars franchises, is acquiring Fox, the third-largest studio by that metric, known for the blockbuster X-Men and Avatar franchises as well as a host of mid-budget crowd-pleasers and critically acclaimed films.

It also brings brands such as FX, National Geographic, and The Simpsons into the same fold as ESPN and ABC — all part of Disney's gamble that a beefed-up company will be better equipped to tackle a slew of Silicon Valley giants.

Disney will pay $52.4 billion for Fox, which for its part will spin off Fox broadcast networks, the Fox News Channel, and Fox Business Channel, the Fox studio lot in Los Angeles, and several national sports channels, leaving them in the hands of 21st Century Fox chairman Rupert Murdoch and his family. Robert Iger, the chairman and chief executive of Disney who had been rumored to be considering a run for president, will continue with the combined firm through 2021.

The announcement takes two media and entertainments titans and, after a period of negotiating chess, essentially divides up territory between them. Iger will lead the legacy-entertainment charge against a slew of new competitors, while Murdoch will attempt to fend off the challenge on another front, as the business of news and live programming face challenges from digital upstarts.

Each side sought to paint its business as stronger because of the moves.

"The acquisition of this stellar collection of businesses from 21st Century Fox reflects the increasing consumer demand for a rich diversity of entertainment experiences that are more compelling, accessible and convenient than ever before," Iger said in a statement Thursday. "We're excited about this extraordinary opportunity to significantly increase our portfolio of well-loved franchises and branded content to greatly enhance our growing direct-to-consumer offerings."

"The new Fox will draw upon the powerful live news and sports businesses of Fox, as well as the strength of our broadcast network," said Murdoch. "It is born out of an important lesson I've learned in my long career in media: namely, content and news relevant to viewers will always be valuable."

On a conference call with analysts, Murdoch said the acquisition would leave the entertainment world with "two of the most iconic, relevant, and dynamic media companies" while on his own call Iger noted that Disney would be "well-positioned to flip the switch to distribute programs and channels direct-to-consumers," alluding to the ways that the Silicon Valley companies have disrupted the entertainment business.

There had been rumors that James Murdoch, one of Rupert's sons and the CEO of 21st Century Fox, would be given a top executive role at Disney as part of the deal, but Thursday brought no definitive word of such a move. Iger said he looked forward to talking to James Murdoch about it in the coming months.

As part of the all-stock deal, Disney will also acquire Fox's 30 percent stake in Hulu, a group of U.S. cable stations including FX and National Geographic, several powerhouse international satellite channels such as Star India and Sky Italia, and a host of U.S. regional sports outlets.

The deal takes Murdoch out of much of the scripted television game and all of the film business, ending a Hollywood association that began more than three decades ago when Murdoch paid about $600 million to buy 20th Century Fox from industrialist Marvin Davis and crested as recently as 2014 when Fox led all studios by market share for the first time this century.

On their call, the Murdochs sought to explain their rationale for the sale.

"I know a lot of people are asking why the Murdochs came to such a momentous decision," Rupert Murdoch said. The company was not retreating, he noted, but "proud to recommit and enable shareholder [opportunities] for years to come."

Lachlan Murdoch, Rupert's son and the executive cochair of 21st Century Fox, noted that "while the merged business is about scale, the new Fox is about returning to our roots as a lean and aggressive brand." The family said there had not been talk yet of recombining with the print media-driven News Corp. "If we do, it's well into the future," Rupert Murdoch said.

For Iger, Thursday's deal amounts to another feather in an already decorated cap that includes the successful acquisitions of Pixar, Marvel, and Lucasfilm.

But Fox will provide the greatest integration challenge yet, with many of the newly acquired company's divisions overlapping with Disney's existing operations. And greater scale, while valuable in negotiating traditional distributor deals with cable operators and movie theaters, is no guarantee of direct-to-consumer success.

Wall Street was relatively neutral on the announcement, which had been expected: Fox's stock price finished up $2.13, or 6.5 percent, to close at $34.88, while Disney's share price finished up $2.91, or 2.7 percent, to close at $110.57. Over the course of the week Disney's price has inched up by around 2 percent, while Fox's has slipped approximately 3 percent.

Regulators and shareholders must still approve the Disney-Fox deal. In a very different scenario, the Department of Justice is currently suing AT&T to stop its acquisition of Time Warner, noting concerns about the marriage of a distributor and content provider.

Fox currently employs well over 20,000 people around the world, many of them at the divisions being acquired by Disney.

Combined, the new Disney could boast as much as $75 billion in revenue, with nearly a third coming from Fox assets.

The deal makes Disney a behemoth of the type entertainment has never seen before and sets the stage for a battle with Silicon Valley titans like Netflix, Apple, and Google. The conglomerate is building up scale in the hope of fending off those firms' forays into the content market; it is also stockpiling content for a new streaming service that it hopes will stem a tide of cord-cutting that has afflicted properties like ESPN.

On the Disney call, Iger said that he envisions Disney's new service and Hulu as coexisting, the former in a "family vein" and latter as "adult-oriented." Analysts, however, have wondered what the future of Hulu will hold now that Disney would own a controlling 60 percent stake (Comcast Universal has 30 percent and Time Warner the remaining 10 percent) and can decide to shift its resources to its proprietary platform.

The Disney acquisition hints at a further industry consolidation, analysts say, that could see Viacom, CBS, Lionsgate, and Sony seek large buyers too, and leave just a few large legacy conglomerates such as Disney-Fox, Comcast Universal, and a potential AT&T Time Warner.

The news provides a bookend of sorts to a 1995 merger that also saw Disney combine with a television giant — Capital Cities/ABC — setting off a wave of entertainment-industry consolidation. Coincidentally, it was that deal that brought Iger into the Disney fold: He was the president of Capital Cities/ABC at the time.

In the call, Iger alluded to that past, saying he was a "product" of that merger, which in turn makes him "respect and appreciate the talent" that comes with the Fox acquisition.