FILE - In this May 9, 2017, file photo, White House press secretary Sean Spicer speaks during the daily press briefing at the White House in Washington. White House Press Secretary Sean Spicer has resigned over hiring of new communications aide. (AP Photo/Evan Vucci, File)

WASHINGTON (AP) — White House press secretary Sean Spicer abruptly resigned Friday over President Donald Trump’s decision to tap a camera-ready financier to lead the beleaguered White House communications team. The departing spokesman said the president “could benefit from a clean slate” as he seeks to steady operations amid the Russia investigations and ahead of a health care showdown.

Spicer, whose daily briefings once dominated cable television and delighted late-night comics, quit in protest over the hiring of Anthony Scaramucci as the new White House communications director. Spicer denounced what he considered Scaramucci’s lack of qualifications, according to people familiar with the situation who were not authorized to speak publicly about it.

As his first act on the job, Scaramucci, a polished television commentator and Harvard Law graduate, announced from the White House briefing room that Sarah Huckabee Sanders would take Spicer’s job. She had been Spicer’s deputy.

The shake-up among the president spokespeople comes as Trump is suffering from dismal approval ratings and struggling to advance his legislative proposals. As his effort to replace Barack Obama’s health care law crumbled this week, the president continued to vent frustration about the attention devoted to investigations of allegations of his election campaign’s connections to Russia. Trump has blamed his own messengers — as well as the “fake news” media — for his woes.

Trump, who watches the press briefings closely and believes he is his own best spokesman, saluted Spicer’s “great ratings” on TV and said he was “grateful for Sean’s work on behalf of my administration and the American people.”

Later, Trump tweeted, “Sean Spicer is a wonderful person who took tremendous abuse from the Fake News Media – but his future is bright!”

Scaramucci, who said Spicer had been gracious in showing him around on Friday, quickly took center stage, parrying questions from reporters and praising Trump in a 37-minute charm offensive. He flashed the television skills that Trump has long valued: He commended Trump’s political instincts and competitiveness, cracked a few self-deprecating jokes and battled with reporters who categorized the West Wing as dysfunctional, saying “there is a disconnect” between the media and the way the public sees the president.

“The president has really good karma and the world turns back to him,” Scaramucci said.

Spicer said during a brief phone conversation with The Associated Press that he felt it would be best for Scaramucci to build his own operation “and chart a new way forward.” He tweeted that it had been an “honor” and “privilege” to serve Trump and that he would remain in his post through August.

His decision to quit took advisers inside and outside the White House by surprise, according to people with knowledge of the decision. They spoke on condition of anonymity because they were not authorized to discuss the personnel matter publicly.

Spicer’s daily press briefings had become must-see TV until recent weeks when he took a more behind-the-scenes role. Sanders has largely taken over the briefings, turning them into off-camera events.

The White House had been looking for a new communications director for several weeks, but struggled to attract an experienced Republican hand. Scaramucci, a former Democrat — like Trump — who once called his new boss a “hack politician,” began seriously talking to the White House about the position this week, and the president offered him the job Friday morning.

A person with knowledge of the decision said Trump has been impressed by Scaramucci’s defense of the White House on television and by his handling of a recent incident with CNN. The cable channel retracted a story about Scaramucci and fired three journalists.

A shift in briefing-room tone and style was immediate. Scaramucci’s delivery was smooth and polished. Spicer, who displayed a sometimes-fiery and occasionally flustered demeanor in on-camera exchanges with reporters, became widely known, particularly through an impersonation by Melissa McCarthy on NBC’s “Saturday Night Live.” McCarthy’s signature move was to plow down reporters with the podium when exasperated by questioning.

Spicer had long sought the strategic communications job for himself and had been managing that role along with his press secretary duties for nearly two months.

He had spent several years leading communications at the Republican National Committee before helping Trump’s campaign in the general election. He is close to White House chief of staff Reince Priebus, the former RNC chair.

Priebus told The Associated Press he supports Scaramucci “100 percent,” despite reportedly trying to prevent the financier from getting multiple administration positions. Ivanka Trump, the president’s daughter, and her husband, powerful senior aide Jared Kushner, had known Scaramucci for years from New York and pushed for his hire.

Scaramucci, a frequent visitor to Trump Tower during the transition, is expected to play a visible role as one of Trump’s defenders on television. But Spicer and other officials questioned his hiring as communications director ahead of the president’s push to overhaul the tax system and other policy issues.

As a Wall Street titan-turned-TV talking head, Scaramucci has no government experience and no experience crafting communication strategy around policy. The White House said he will officially take over the role on Aug. 15.

It’s unclear whether the new leadership will lead to a more open White House.

Scaramucci did not commit to putting briefings back on camera full-time. He also offered a level of support for some of Trump’s more outlandish statements, including his unsupported claim that millions of illegal votes were cast in the 2016 election.

“If the president says it … there’s probably some level of truth to that,” he said.

He also made clear that he would continue Trump’s efforts to push back against media reports he doesn’t like — and would do a better job of selling his victories.

“The president is a winner. And we’re going to do a lot of winning,” said Scaramucci, who blew a kiss to the press corps before departing.

Scaramucci notably said he reports directly to the president, not to the chief of staff — a highly unusual arrangement for a communications director and a possible reflection that Priebus’ standing with Trump is often uncertain.

Back in January, Spicer’s tenure got off to a rocky start. On Trump’s first full day in office, he lambasted journalists over coverage of the crowd size at the inauguration and stormed out of the briefing room without answering questions.

Spicer remained loyal to Trump but frequently battled perceptions that he was not plugged in to what the president was thinking.

The resignation comes a day after Mark Corallo, the spokesman for the president’s outside legal team, left his post. And in a separate move, former White House aide Katie Walsh is returning to the RNC, spokesman Ryan Mahoney said. Walsh will serve as an adviser on data and digital issues, and the appointment is unrelated to the White House personnel changes, he said.

___

Associated Press writers Jonathan Lemire, Julie Pace, Darlene Superville, Vivian Salama in Washington and David Bauder in New York contributed to this report.