WASHINGTON — Steve Bannon is out as President Donald Trump’s chief strategist, ending a controversial tenure for the self-described populist and nationalist.

“White House chief of staff John 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,” White House Press Secretary Sarah Huckabee Sanders said.

It’s unclear whether Bannon was fired or whether he resigned. The New York Times reported that Bannon offered his resignation on Aug. 7, but it was also made clear that Kelly was seeking his ouster.

Bannon parlayed a Hollywood career as a producer and financial broker and later led Breitbart News Network, before he was named Trump’s campaign CEO as it was faltering in August 2016.

But Bannon has become a target inside and outside the White House, and the decision to oust him was made after Kelly completed a review of White House operations. Bannon clashed with a cadre of more moderate Trump advisers from New York, including Gary Cohn and Jared Kushner. Rupert Murdoch reportedly urged Trump to fire Bannon.

His fate has been in doubt since Kelly succeeded Reince Priebus as chief of staff late last month, but in recent days it became clearer that Trump was looking for him to exit. At Trump’s press Q&A at Trump Tower in New York on Tuesday, the president said that Bannon was a “friend of mine” and that the press “treats him unfairly.” But asked about his future, Trump said, “We’ll see.”

Bannon also had stayed in Washington, working out of temporary space in the Old Executive Office Building, as Trump went on a working vacation in Bedminster, N.Y. and the West Wing underwent a renovation.

Bannon is expected to return to Breitbart, sources said. He had viewed his tenure in the White House as lasting about a year or even less, but would not step away from the political fight. There were reports that he met earlier this week with Robert Mercer, a billionaire ally.

Bannon on the outside is a prospect that could prove to be precarious for Trump if the administration takes a more moderate course on a host of issues like trade, as Bannon would have a megaphone with a large following. Some of Bannon’s Hollywood supporters are quick to point out that outside of Trump, he was the only senior administration official to have “a constituency.”

Charlie Spiering, the White House correspondent for Breitbart, tweeted, “And kids, that’s the day when Bannon the Barbarian was born…”

Joel Pollak, senior editor at large at Breitbart, tweeted shortly after Bannon’s ouster, “#WAR.”

Breitbart News has labeled figures like Cohn as “globalists,” and it is expected the outlet will continue to target Trump’s New York advisers. Bannon also sharply disagreed with H.R. McMaster, Trump’s current national security adviser, and was accused of being behind attacks on McMaster in right-wing media.

Since then, Bannon has given a few rare interviews, in which he seemed to relish Democrats’ embrace of identity politics as something that would ultimately help Trump. But the American Prospect published an interview in which Bannon said there was “no military solution” to North Korea’s threats, a contrast to Trump’s rhetoric that the Pyongyang regime would see “fire and fury” if they continued to provoke the United States.

After Trump’s surprise electoral win, he chose Bannon as his chief strategist, and even made him a member of the National Security Council. He was later removed from the NSC, after the resignation of Michael Flynn.

Bannon was a lighting rod from the start, particularly for having led a news operation that had a heavy audience from the so-called “alt-right.” In talking to the American Prospect, Bannon called “ethno-nationalists” “losers,” part of the “fringe” and a “collection of clowns.”

Bannon also championed a destruction of what he called the “administrative state,” and his advocacy of a host of nationalist positions had a potentially big impact on the entertainment industry. He pushed for aggressive action on China, telling the American Prospect that the country was at an “economic war” with the country. He even advocated to classify Google and Facebook as utilities — given their ubiquity in American households.

Bannon seemed to relish the attention that he got for disruption and as an architect of Trump’s America First strategy, even when he was demonized from the left. (“Saturday Night Live” portrayed him in a skeleton outfit). He had been viewed as the leading voice in the administration of pursuing strategies that excited Trump’s base, and pushed early action on issues like immigration. He had a hand in Trump’s inaugural address, in which the president talked of looking out for the “forgotten men and women of our country,” but also of the “American carnage” across the country.

But Trump was said to be upset when Bannon would command the spotlight, including a Time magazine cover that labeled him “The Great Manipulator.” More recently, Bannon was the subject of Joshua Green’s book “Devil’s Bargain,” which chronicled his role in helping get Trump elected.