White House press secretary Sean Spicer abruptly resigned Friday, ending a rocky six-month tenure that made his news briefings defending U.S. President Donald Trump must-see TV.

He said Trump's communications team "could benefit from a clean slate" as the White House seeks to steady operations amid the Russia investigations and ahead of a health-care showdown.

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 as well as the direction of the press operation, according to people familiar with the situation.

It's been an honor & a privilege to serve <a href="https://twitter.com/POTUS">@POTUS</a> <a href="https://twitter.com/realDonaldTrump">@realDonaldTrump</a> & this amazing country. I will continue my service through August —@PressSec

Scaramucci, a polished television commentator and Harvard Law graduate, quickly took centre stage at a briefing, parrying questions from reporters and commending Trump in a 37-minute charm offensive.

As his first act on the job, Scaramucci announced that Sarah Huckabee Sanders would be the new press secretary. She had been Spicer's deputy.

Scaramucci will start next month. The Republican fundraiser and founder of Skybridge Capital has most recently worked at the Export-Import Bank of the United States. He was earlier offered the post of U.S. ambassador to the Organization for Economic Co-operation and Development in Paris.

Spicer said on social media that he will stay on until August, and that it had been an honour and privilege to serve the president. He had been serving as both communications director and press secretary following the departure of communications director Michael Dubke, who resigned in May.

"I am grateful for Sean's work on behalf of my administration and the American people," a statement from Trump read. "I wish him continued success as he moves on to pursue new opportunities."

According to a report in the New York Times, Spicer strongly objected to Scaramucci's appointment, saying it was a major mistake.

Spicer gave no indication of conflict during a brief phone conversation with The Associated Press following his announced departure.

He said he felt it would be best for Scaramucci to be able to build his own operation "and chart a new way forward."

Spicer said of Scaramucci's hiring: "It'll be great, he's a tough guy."

Scaramucci for his part praised Spicer and said there was no friction with the departing press secretary or chief of staff Reince Priebus, contrary to some press reports.

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

Trump's statement praised Spicer's "great television ratings."

Scaramucci's appointment comes as the White House deals with questions around a special counsel probe and several congressional investigations into alleged Russian meddling in the 2016 U.S. presidential election and potential collusion with Trump's campaign.

'The ship is going in the right direction'

At a press briefing Friday with Sanders, Scaramucci, 53, raved about Trump's political instincts at the podium and took exception to the characterization that the administration has been dysfunctional.

"The ship is going in the right direction, we've just got to radio signal the direction very, very clearly," he said.

Scaramucci said Trump is doing a phenomenal job and that he'll work with the rest of the White House communications team to get that message "out there a little more aggressively."

He called Spicer "a true American patriot" and said he hopes Spicer "goes on to make a tremendous amount of money."

Scaramucci predicted the administration would be able to push through desired health-care and tax code reforms, despite stalled momentum in Congress on the health-care file.

He was non-committal as to whether more press briefings would be back on camera, as has been custom in recent years.

After answering a range of questions, Scaramucci blew a kiss and waved to journalists before leaving the briefing room.

Sarah Huckabee Sanders, who has handled most of the media briefings of late, will be the new White House press secretary. (Alex Brandon/Associated Press)

Scaramucci was one of the people named in a recent CNN story, which the network later retracted. The story said Congress was investigating a "Russian investment fund with ties to Trump officials."

He disputed the story, insisting he did nothing wrong. Three CNN journalists resigned and the network also apologized to him, adding the piece "did not meet CNN's editorial standards."

Spicer spent several years leading communications at the Republican National Committee (RNC) before helping Trump's campaign in the general election. He is close to White House chief of staff Priebus, the former RNC chair, and several of the lower-ranking aides in the White House communications shop.

Memorable clips of the former White House press secretary 1:27

But his tenure got off to a rocky start.

On Trump's first full day in office, Spicer lambasted journalists over coverage of the crowd size at the inauguration and stormed out of the briefing room without answering questions.

He also endured other moments of teasing from the press, including stumbling over the name of Canadian Prime Minister Justin Trudeau, and comparing Syrian leader Bashar al-Assad to Adolf Hitler.

His fiery demeanour and tense on-camera exchanges were mocked on Saturday Night Live, with the role of Spicer being played by actress Melissa McCarthy.

Outgoing White House press secretary tells Fox News' Sean Hannity 'you have to have a thick skin' 0:58

Spicer becomes the latest departure amid a number of resignations and firings in the first six months of the Trump administration. They include acting attorney general Sally Yates, national security adviser Michael Flynn, FBI director James Comey, vice-president chief of staff Josh Pitcock and Walter Shaub, the head of the office on government ethics, who resigned earlier this month and has gone public with concerns that Trump may be personally profiting from the presidency.

In addition, Trump expressed his displeasure with Jeff Sessions in an interview earlier this week, but the attorney general said the following day he would continue to serve "as long as that is appropriate."