WASHINGTON — President Trump on Friday dismissed his embattled chief strategist, Stephen Bannon, an architect of his 2016 general-election victory and the champion of his nationalist impulses, in a major White House shake-up that follows a week of racial unrest.

With Trump’s presidency floundering and his legislative agenda in shambles, administration officials said his empowered new chief of staff, John Kelly, moved to fire Bannon in an effort to tame warring factions and bring stability to a White House at risk of caving under its self-destructive tendencies.

A combative populist on trade and immigration, Bannon was arguably Trump’s ideological id on the issues that propelled his candidacy. He served as a key liaison to the president’s conservative base and the custodian of his campaign promises.

Bannon had been a lightning rod for controversy since joining Trump’s campaign last summer, but he attracted particular scorn in recent days for encouraging and amplifying the president’s divisive remarks in the wake of last weekend’s deadly white supremacist demonstration in Charlottesville, Virginia.

Sarah Huckabee Sanders, the White House press secretary, said in a Friday afternoon statement to reporters: “White House Chief of Staff John F. Kelly and Steve Bannon have mutually agreed today would be Steve’s last day. We are grateful for his service and wish him the best.”

Some White House officials also said Friday that they expect some of Bannon’s allies inside the administration to exit with him. Two such people are national security aide Sebastian Gorka and presidential assistant Julia Hahn, although both have portrayed themselves in recent talks with colleagues as Trump allies first and Bannon allies second.

Despite his ideological similarities with Bannon, senior policy adviser Stephen Miller is seen as safe. He joined the campaign long before Bannon and has his own relationships with the president and other senior advisers. He has also distanced himself from Bannon in recent weeks.

BACK TO THE WEBSITE

Bannon – a former executive chairman of Breitbart News, a fiery, hard-right site that has gone to war with the Republican establishment – for months was locked in a long and tortuous battle with senior adviser Jared Kushner, the president’s son-in-law, and a coterie of like-minded senior aides, many with Wall Street ties.

Hours after his departure was confirmed Friday by the White House, Bannon was already back in charge at the website, chairing the evening editorial meeting.

“The populist-nationalist movement got a lot stronger today,” Breitbart News Editor-in-Chief Alex Marlow said in release with the headline “‘Populist Hero’ Stephen K. Bannon Returns Home to Breitbart.”

Bannon had been expecting to be cut loose from the White House, people close to him said. One of them explained that Bannon was resigned to that fate and is determined to continue to advocate for Trump’s agenda on the outside.

“No matter what happens, Steve is a honey badger,” said this person, who like others interviewed spoke on condition of anonymity. “Steve’s in a good place. He doesn’t care. He’s going to support the president and push the agenda, whether he’s on the inside or the outside.”

Bannon has told associates in recent days that if he were to leave the White House, the conservative populist movement that lifted Trump in last year’s campaign would be at risk. One person close to him said that the coalition would amount to “Democrats, bankers and hawks.” Bannon also predicted that Trump would eventually turn back to him and others who share the president’s nationalist instincts, especially on trade.

Bannon allies said they expect him to remain largely loyal to the president, while training his harshest fire on those in Trump’s orbit he believes bring a Democratic, “globalist” worldview to the administration. But with Bannon out of the West Wing, Breitbart News is more likely to begin mobilizing its audience against the White House on issues such as immigration, where it thinks Trump is not keeping his campaign promises, said someone familiar with the organization’s approach.

Rep. Steve King, R-Iowa, who is close to Bannon, said Trump’s base could revolt. “With Steve Bannon gone, what’s left of the conservative core in the West Wing? Who’s going to carry out the Trump agenda?” he asked in an interview.

King suggested that Trump fill Bannon’s political-strategist seat with former deputy campaign manager David Bossie, who has his own connections to Trump’s base.

“This looks like a purging of conservatives,” King said. “The odds of him completing his campaign promises, even to the limit of his executive authority, have been diminished by this.”

Though Bannon’s firing is being interpreted as a victory for the cadre of more moderate White House advisers, several operatives with ties to the conse rvative movement remain in Trump’s circle, including counselor Kellyanne Conway, deputy chief of staff Rick Dearborn and legislative affairs director Marc Short.

Still, the consequences on Capitol Hill could be wide-ranging. House and Senate Republican leadership have long been wary of Bannon, and their allies were cheering Friday at news of his departure. But among the hard right in Congress – including Rep. Mark Meadows, R-N.C., chairman of the House Freedom Caucus – there was anger and doubt that anyone left in the White House shares their appetite for political confrontation.

OUTRAGE FROM STAFF

The decision to fire Bannon was made by Kelly, the retired four-star Marine Corps general brought in late last month as White House chief of staff, officials said. It came after exactly three weeks in a position where he was given unilateral power to overhaul the West Wing staff in an effort to stanch warring among factions, aides and advisers going rogue and repeated leaks to the news media.

“This was without question one man’s decision: Kelly. One hundred percent,” one senior White House official said. “It’s been building for a while.”

This past week, as mainstream Republicans lambasted Trump for his handling of the Charlottesville violence, many on the White House staff led a drum beat for the president to dismiss Bannon and any other aides who have connections of any kind to the white nationalist movement, the official said.

“The fevered pitch was basically outrage from dozens on the staff that anybody who’s ever had a part of that has to be purged immediately,” the official said.

Kelly has no personal animus toward Bannon, said people familiar with his thinking. But Kelly was especially frustrated with Bannon’s tendency to try to influence policy and personal matters not in his portfolio, as well as a negative media campaign he and his allies waged against national security adviser H.R. McMaster.

A person close to Kelly said he was intent on making the White House not only less chaotic but also less driven by a particular ideology. He made clear to his deputies that he did not want to align with any faction, but rather to shake up a culture on the staff where power seemed to drift from group to group. Rather, Kelly said he wanted power to drift from Trump to him, period. The president would be given ideas to choose from, rather than hearing a parade of whispers on the phone and in the Oval Office from competing blocs.

Trump, meanwhile, had been upset about Bannon’s participation in a book by Bloomberg News reporter Joshua Green, “Devil’s Bargain” – particularly a cover photo giving equal billing to Trump and his chief strategist. Every time Green was on CNN, where he is now a contributor, Trump grew unhappy with his references to Bannon as a thinker and strategist – and upset that the conversation was not instead about Trump.

Bannon’s critics noticed that Trump hated this narrative and would casually mention the book whenever they could in private conversations, slowly building a case against Bannon as a self-promoter.

This week, at a moment when even his allies and confidants agreed his job security was as precarious as ever, Bannon further imperiled his standing by giving an interview to the liberal American Prospect magazine, in which he sniped by name at his enemies within the White House – including Gary Cohn, the National Economic Council director – and publicly contradicted the administration’s stance on North Korea.

Bannon confidants said he believed his conversation with the magazine was off the record, but the damage was done. Kelly, said two people familiar with his thinking, was most frustrated by Bannon’s comments on North Korea.

As Bannon waited to hear his fate in recent days, he was keeping in close touch with billionaire ally Robert Mercer and other longtime friends and benefactors in conservative politics and the right-wing media community. He expressed a desire to stay in the White House while also musing about what his future could be outside of the federal government, according to people familiar with the conversations.

Associates said Bannon may partner on a new venture with the Mercer family, conservative mega-donors who served as his patrons in an array of enterprises before he joined the Trump campaign. One strong possibility is a new media entity.

“They have a very strong working relationship together and I would be shocked if we don’t hear of a major initiative involving Steve and the Mercers in the next 30 to 60 days,” said a person familiar with the family’s views, who requested anonymity to describe the thinking of the Mercers. “They don’t walk in lockstep in terms of their views, but they like the fact that Steve gets results and they think money put into ventures he’s involved in is money well spent.”

SUCCESSFUL VENTURES

Mercer, a hedge fund executive, and his daughter Rebekah collaborated with Bannon on at least five ventures between 2011 and 2016, including Breitbart, which Bannon ran. He also served as vice president and secretary of the Mercer-funded Cambridge Analytica, a data science company that worked for Trump’s campaign.

Bannon earned at least $917,000 in 2016, drawing at least $545,000 of that from four Mercer-backed ventures, according to a personal financial disclosure he filed in late March. At the time, he estimated that his assets were worth between $11.8 million and $53.8 million. Among his holdings: three rental properties and a strategic consulting firm he said was worth between $5 million and $25 million. The filing also showed that Bannon had significant cash reserves, reporting at least $1.1 million in three different U.S. bank accounts. Much of Bannon’s time in recent days was spent in the Eisenhower Executive Office Building on the White House grounds, as the West Wing is under renovation.