WASHINGTON -- White House press secretary Sean Spicer abruptly resigned his position Friday, ending a rocky six-month tenure that made his news briefings must-see TV. He said President Donald Trump's White House "could benefit from a clean slate."

Spicer quit in protest over the hiring of a new White House communications director, New York financier Anthony Scaramucci, objecting to what Spicer considered his lack of qualifications and to the direction of the press operation, according to people familiar with the situation.

Spicer said during a brief phone conversation with The Associated Press that he felt it would be best for Scaramucci to be able 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 he would remain in his post through August.

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.

His decision to quit was sudden and took advisers inside and outside the White House by surprise, according to the 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-watch television until recent weeks when he took on a more behind-the-scenes role. Deputy press secretary Sarah Huckabee Sanders has largely taken over the briefings, turning them into off-camera events.

Spicer 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, and several of the lower-ranking aides in the White House communications shop.

Priebus told The Associated Press that he supports Scaramucci "100 percent," despite reportedly trying to prevent the financier from getting multiple administration positions.

"We go back a long, long way and are very good friends," Priebus said of Scaramucci. "All good here."

Spicer also complimented Scaramucci, a New York financier and frequent defender of the president who was a staple at Trump Tower during the president's transition, saying "It

'll be great, he's a tough guy."

Scaramucci 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.

Spicer and other press staffers had been feeling that they finally had the press shop operating effectively, aside from matters related to the Russia investigation, said one of the people familiar with the situation.

News of Spicer's resignation set off a chaotic scene at the White House.

Inside the West Wing, a gaggle of reporters more than a dozen deep crowded around a doorway leading to the press offices seeking more information on Spicer's departure and other potential staffing moves. White House officials announced that Sanders would hold the daily briefing -- the first on camera since June 29 -- on Friday afternoon.

Scaramucci's hire was a surprise. He had been told by the administration that he would be nominated as U.S. ambassador to the Organization for Economic Cooperation and Development, an intergovernmental economic organization that includes the world's better-off countries.

A senior foreign official, who demanded anonymity to discuss private personnel discussions, said Scaramucci had been meeting with various foreign diplomats as recently as last week in anticipation of his new role as ambassador to the OECD.

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, who often displayed a fiery demeanor in tense on-camera exchanges with reporters, became part of culture in the way few people in his job have, particularly through an indelible impersonation by Melissa McCarthy on NBC's "Saturday Night Live."

She portrayed Spicer as a hostile figure who tore through the briefing room on a portable podium, willing to attack the press.

A Roman Catholic, Spicer was dealt a blow when Trump excluded him from a group of White House staffers and Trump family members who got to meet Pope Francis when Trump visited the Vatican during his first foreign trip in May.

Spicer remained loyal to Trump but frequently battled perceptions that he was not plugged in to what the president was thinking, and had to worry that Trump was watching and critiquing his performance from the Oval Office.

Throughout the start of the administration, there was always the possibility that Trump would undermine something Spicer said by simply sending out a tweet.

Spicer is a Rhode Island native and a commander in the U.S. Navy Reserve.

He apologized in April after he attempted to compare the Holocaust and Syrian President Bashar Assad's use of chemical weapons, saying it was "inexcusable and reprehensible."

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.

--The Associated Press