Updated on July 28 at 5:57 p.m. ET

For once, the rumors of Reince Priebus’s demise were not exaggerated.

President Trump announced late Friday afternoon that he had named John Kelly as chief of staff, replacing Priebus. Priebus had been the subject of whispers of imminent dismissal more or less since he took the job, but the arrival of communications director Anthony Scaramucci last week, over Priebus’s objection, seems to have sped up his departure.

Trump announced the news via Twitter:

Returning from a speech on Long Island—both Scaramucci and Priebus had flown on Air Force One with him—Trump told reporters at Andrews Air Force Base, “Reince is a good man. John Kelly will do a fantastic job. General Kelly has been a star, done an incredible job thus far, respected by everybody. He’s a great, great American. Reince is a good man.” Priebus then got into a waiting car and departed, separate from the president’s motorcade. He later told The Wall Street Journal’s Michael Bender that he had resigned on Thursday. (White House Press Secretary Sarah Sanders has declined to comment on the timing and process of Priebus’s departure.)

Priebus’s resignation is a turning point for the Trump presidency, but it’s too early to tell whether it will turn for the better or, somehow, the worse. Kelly will inherit a West Wing that has set a new standard for chaos, backstabbing, factionalism, and inefficacy. While every administration suffers from some rivalries, the poisonous atmosphere in Trump’s White House has exceeded all of them, bursting into full view Thursday evening with an explosive series of comments from Scaramucci to New Yorker reporter Ryan Lizza.

“Reince Priebus—if you want to leak something—he’ll be asked to resign very shortly,” Scaramucci told Lizza. “Reince is a fucking paranoid schizophrenic, a paranoiac.”

Scaramucci believed, wrongly, that Priebus had leaked his financial disclosure. (A Politico reporter had obtained it through a routine public-records request.) But the accusation of leaks was the final blow to the chief of staff.

Priebus arrived in the White House after serving as chairman of the Republican National Committee. The bland Wisconsinite was always a somewhat strange fit for the job. Though he’d proven himself a fairly able administrator at the RNC, he had none of the characteristics common to successful chiefs of staff: experience in government and especially the executive branch, a hard-headed ability to get his way, and an unshakeable bond with the president. In fact, Priebus had been wary of Trump’s candidacy all along, and when a tape was released in which Trump bragged about sexually assaulting women, Priebus urged him to drop out of the race—a slight Trump reportedly never forgot.

Nonetheless, the president chose him as chief of staff after his surprise victory, making Priebus the foremost avatar of the Republican establishment in the White House. Trump set Priebus up for failure from the start. The president allowed several rival power centers to exist in the West Wing, including chief strategist Steve Bannon (with whom Priebus often clashed early on), senior adviser Jared Kushner, and aide Kellyanne Conway. Many of these people had Oval Office “walk-in” privileges, allowing them to go directly to Trump without passing through Priebus.

When Trump’s legislative initiatives began to struggle, he lashed out at Priebus, whose close relationship with Speaker Paul Ryan was supposed to make moving legislation through the House easy. Bannon sought to undercut Priebus, portraying him as a “globalist” who didn’t buy into the Trump project. When then-Press Secretary Sean Spicer disappointed Trump, he blamed Priebus, who’d brought Spicer over from the RNC. Priebus was also held responsible for failing to stop leaks, although given that he was a frequent target, he was clearly in no position to do that. News reports repeatedly claimed that Trump was interviewing possible successors.

Scaramucci’s loud, vulgar arrival seems to have finally broken an increasingly fragile arrangement. Priebus, along with Bannon, tried to block the appointment, so when Scaramucci came in, Priebus was not only weakened by the loss but also gained a colleague with a grudge to nurse. Worse, Scaramucci announced that he would report directly to the president, bypassing Priebus. Then came the New Yorker interview.

The departures of Spicer, who resigned over Scaramucci’s appointment, and Priebus leave the GOP establishment almost entirely cleaned out of the White House. Kelly’s elevation, meanwhile, is the latest case of Trump placing his hope in generals. He appointed several retired members of the top brass to his team—Kelly, the current secretary of homeland security; Defense Secretary James Mattis; and Michael Flynn, the national-security adviser fired in February for lying to the vice president. (Scaramucci was said to covet the chief of staff’s job as well.)

Trump has seen an unusual number of high-level departures from his administration for such a short period, including the firing or resignation of a chief of staff, a press secretary, a deputy chief of staff, and a national-security adviser. With Kelly’s departure, Trump will now need to find a new secretary of homeland security, a Senate-confirmed position with important responsibilities—not least the construction of Trump’s beloved border wall and the implementation of his beleaguered travel ban. Trump repeatedly humiliated Attorney General Jeff Sessions over the last week, raising the possibility that he could also leave the administration. Meanwhile, hundreds of Senate-confirmed jobs remain without even a nominee.

The New York Times reported Friday morning that Trump felt he needed a general to lead the White House, someone who could instill more discipline. Kelly will have his work cut out for him. Priebus was ineffective at ending infighting in the White House, but the basic problem is not the chief of staff but the presence of a fractious group of advisers and a scattered president. Kelly will be expected to cut down on leaks, too. But leaks are a symptom of dysfunction, and the way to fix them is to fix the underlying chaos. It’s unclear whether anyone can do that right now.

In fact, given Priebus’s plight, the way Trump has attacked Sessions, and the impossible job that faces him, one wonders what led Kelly to leave a job he seems to have enjoyed leading the Department of Homeland Security. Earlier this spring, I spoke with Leon Panetta, whom Bill Clinton asked to leave a job directing the Office of Management and Budget to become chief of staff at a difficult moment one year into his term.

“I had seen the kind of disruption at the White House and wanted to remain OMB director,” Panetta recalled. “I said, ‘I’m probably more valuable to you as OMB director,’ and I’ll never forget what Clinton said. He said, ‘You know, you could be the greatest OMB director in the history of the country, but if the White House is falling apart, nobody’s going to remember you.”

Panetta’s approach was to simplify the organizational chart at the White House, make himself the gatekeeper to the Oval Office, and keep the president away from distraction. But he had the benefit of a president who realized that’s what he needed.

Kelly, however, faces a West Wing in worse chaos than Clinton’s; a raft of fractious advisers, including Jared Kushner, who is essentially unfireable because he is the president’s son-in-law; a special-counsel investigation by Robert Mueller; and Scaramucci, who in his first week on the job has already proven himself a loose cannon and brought down one chief of staff. Yet the biggest challenge for Kelly is finding a way to channel the president’s energy and keep him on track. Scaramucci’s credo has been to “let Trump be Trump,” but given the results over the last six months, Kelly’s fate may hinge on his ability to keep Trump from being Trump.