For a while, Rupert Murdoch seemed invincible.
First, the mogul emerged relatively unscathed from a 2011 phone hacking scandal involving his British tabloids that threatened to upend his empire. Then, he installed his sons, Lachlan and James, in leadership roles at 21st Century Fox. And, last year, the thrice-divorced Mr. Murdoch married Jerry Hall, a former supermodel 25 years his junior.
But even Mr. Murdoch, a self-made billionaire whose range of media assets wield enormous political influence on three continents, was no match for Silicon Valley.
Like King Lear confronting his mortality, Mr. Murdoch, 86, is preparing to divide up a lifetime of spoils. And as he moves to sell off wide swaths of his media and entertainment business, he is also throwing into confusion the line of succession and testing the ties that bind the family-run fief.
The Walt Disney Company announced on Thursday it had reached a deal to acquire most of 21st Century Fox Inc., the Murdoch-owned company that includes the storied movie and television studio, national cable networks like FX and National Geographic, 22 regional cable channels dedicated to sports and a 39 percent stake in Britain's pay TV service, Sky.
The $52.4 billion deal — which would not include Fox News, the Fox broadcast network or the FS1 sports cable channel, which will be spun off into a newly listed company — has come about as part of the consolidation sweeping over traditional media companies as they try to fight off threats from Amazon, Apple and Netflix. It also represents a remarkable shift for Mr. Murdoch, a visionary businessman who has long lived by a single credo: Buy, buy, buy.
After all, Mr. Murdoch didn't grow a single newspaper in Adelaide, Australia, into a $100 billion media business by selling. "Rupert has always been a collector, a builder," said Laura Martin, an analyst at Needham & Company.
In 2007, when newspapers were facing a decline, Mr. Murdoch defied Wall Street investors and his own advisers to pay $5 billion for Dow Jones, the company that publishes The Wall Street Journal. Why? Because he wanted to.
In 2012, under pressure in the wake of the phone-hacking scandal, Mr. Murdoch split his entertainment assets into a separate publicly traded company, 21st Century Fox, from News Corporation, the company that includes The Journal, the New York Post and other newspapers. For a time Mr. Murdoch's enterprise looked like an entertainment company with a newspaper problem, with glitzy Hollywood assets and lucrative Fox News keeping Mr. Murdoch's true love, printed papers, afloat.
But 21st Century Fox soon faced the same economic headwinds affecting other traditional media companies that have been disrupted by the rise of digital: customers cut the cable cord and streamed TV shows and movies on multiple devices. At the same time, Fox News, the highly rated basic cable channel and a big moneymaker, has suffered setbacks after a series of sexual harassment allegations at the network led to high-level departures and costly legal settlements.
Mr. Murdoch must have known he needed to get even bigger to survive. But lately his buying prowess has taken a hit. In 2014, investors rebuffed him when he tried to gain scale with an $80 billion offer for Time Warner Inc., the company that owns HBO and CNN — and which may end up the property of AT&T, if a deal long in the making survives the scrutiny of a skeptical Justice Department. Regulatory hassles have also thwarted Mr. Murdoch's efforts to pay $15 billion for the 61 percent stake in Sky not already owned by 21st Century Fox.
"He tried to buy, and when that didn't work, he doesn't sulk — he sells," Ms. Martin said.
Disney's planned acquisition of 21st Century Fox — Mr. Murdoch's confidants call it a merger — makes economic sense, analysts say, and may be the best way for Mr. Murdoch's broader empire to thrive. But it also makes the identity of his heir less apparent.
Mr. Murdoch's younger son, James, 44, has reinvented himself since an intense legal imbroglio in Britain that sprang up after the News of the World tabloid hacked into the voice mail of a 13-year-old murder victim. James Murdoch, who is said to be supportive of the Disney deal, left his post in London, moved to the United States and took over one of his father's jobs: chief executive of 21st Century Fox.
Lachlan Murdoch, the elder brother at 46, has been caricatured as the prodigal son. He left the family business in 2005 and was happily living out of the fray in Australia, with a supermodel wife and a trust fund. But as part of Mr. Murdoch's succession plan, Lachlan returned to the United States in 2015 to serve with his younger brother — and alongside his father, as co-executive chairman — at 21st Century Fox. Seen by some insiders as a daddy's boy, he moved into his father's former office on the company's palm-tree-lined lot in Beverly Hills.
Questions abound about which son would carry on the family legacy, should the Disney deal go through. (Mr. Murdoch's older daughters, Prudence and Elisabeth, have stayed mostly out of the business, and his younger daughters, Grace and Chloe, are teenagers.)
"You have this issue with two sons who are seemingly capable of commercial success and, if you're Rupert, you want to leave them both in a good spot, for lack of a better spot," said Brian Wieser, an analyst at Pivotal Research.
In one possible outcome, James Murdoch would take on an executive position at Disney, and Lachlan Murdoch, who shares his father's passion for news, would move to News Corporation or oversee the company that absorbs Fox News and the Fox broadcast channel.
"The Disney deal gives Lachlan a clear run to manage the remnants," said Neil Chenoweth, an Australian financial journalist and author of "Rupert Murdoch: The Untold Story of the World's Greatest Media Wizard."
A company insider who could only discuss ongoing deal negotiations anonymously said it was too early to know what roles the Murdoch sons would take on, and added that James Murdoch could decide to strike out on his own.
Robert A. Iger, the chief executive of Disney, has agreed to stay on after his planned retirement in 2019. Analysts widely agreed that, despite speculation, James Murdoch would not be in serious contention for Mr. Iger's job.
Unlike Sumner Redstone, the 94-year-old billionaire magnate behind Viacom and CBS Corp. who lusted after Paramount Studios and the red-carpet prestige of owning a movie studio, Mr. Murdoch has always been more enamored with ink-stained newsrooms.
The Disney deal would leave him without a seat at the Dolby Theater for the Academy Awards — a string of Fox Searchlight Pictures films including "Slumdog Millionaire," "12 Years a Slave" and "Birdman" have won best picture Oscars — but Mr. Murdoch would maintain his seat at the White House. In August, the family patriarch had a private dinner with President Trump; Mr. Trump's son-in-law Jared Kushner, a senior White House adviser; and the White House chief of staff John F. Kelly.
Mr. Murdoch talks regularly with Mr. Kushner, who knows a thing or two about tiptoeing around powerful family business dynamics. People close to Mr. Murdoch and Mr. Kushner described them as friends, but others saw a transactional relationship.
"Rupert is a guy who doesn't have friends," said Mr. Chenoweth, the Murdoch biographer.
Mr. Trump, meanwhile, remains tethered to Fox News and fixated on The Journal's editorial page. During the 2016 Republican primary, he desperately sought Mr. Murdoch's approval, despite the mogul's skepticism of both his presidential bid and his business bona fides. "When is Donald Trump going to stop embarrassing his friends, let alone the whole country?" Mr. Murdoch wrote on Twitter after Mr. Trump mocked Senator John McCain of Arizona for having been captured during the Vietnam War.
Mr. Murdoch's news properties will allow him to maintain the political influence that he has cultivated.
"I think he's keeping his passion projects," said BTIG analyst Richard Greenfield.
As for his sons, people close to Mr. Murdoch do not envision a scenario in which either James or Lachlan thrives long-term at the top of a company that doesn't have their father's stamp on the door.
In a joint memo to employees sent last week, James and Lachlan tried to quell concerns about the sale. "Uncertainty," they wrote, "always breeds unease."