Sean Spicer has resigned as White House Press Secretary, capping a tumultuous tenure in the White House where he took heat for his sometimes clumsy attempts to defend President Trump as he improvised his way through his first months in office.

He is being succeeded by his deputy, Sarah Huckabee Sanders, and gave notice on a day President Trump offered telegenic New York financier Anthony Scaramucci the job of communications director with plans to make him the face of his White House defense.

On a topsy-turvy day, Scaramucci stunned reporters by showing up at a televised press briefing, taking question after question from reporters where he flattered his boss, avoided factual misstatements, and cracked jokes about making money and 'getting the hook.'

President Trump thanked Spicer in a statement at a televised press briefing Friday.

Scroll down for video

Anthony Scaramucci attends the daily White House press briefing in the Brady Press Briefing Room at the White House July 21, 2017 in Washington, DC. White House Press Secretary Sean Spicer resigned after it was announced that Trump hired Scaramucci, a Wall Street financier and longtime supporter, to the position of White House communications director

'I am grateful for Sean's work on behalf of my administration and the American people. I wish him continued success as he moves on to pursue new opportunities. Just look at his great television ratings. Sean will continue to serve the administration through August,' Trump said – in a statement read by Sanders, who didn't smile as she took the podium on a tumultuous day.

Scaramucci stunned reporters by taking questions during a live televised briefing. Spicer was pictured walking out of his office – and did not attend – after being holed up inside the room for hours.

Scaramucci said off that bat that he spoke to Trump about 'letting him be himself.' He assured reporters - who had a contentious relationship with Spicer – that he would 'get to everybody' as he fielded questions.

'I'm going to try to get to everybody - I promise,' he said.

'I love the president and I’m very very loyal to the president,' Scaramucci said.

'I want to thank personally Sean Spicer not only on behalf of myself, the president, and the administration, but Sean is a true American patriot, he's a military serviceman, he's got a great family, and he's done an amazing job,' Scaramucci said.

EXIT: White House press secretary Sean Spicer walks out of the West Wing while new communications director Anthony Scaramucci takes the White House podium

Out: Sean Spicer (above on Thursday) has resigned from his tole as White House Press Secrtary

HOW CARD CAN THIS BE? White House Principal Deputy Press Secretary Sarah Huckabee Sanders (R) and Anthony Scaramucci arrive for the daily White House press briefing in the Brady Press Briefing Room at the White House July 21, 2017 in Washington, DC

'Obviously this is a difficult situation to be in and I applaud his efforts and I love the guy and I wish him well.'

Then he made a quip certain to endear himself to the president. 'And I hope he goes on to make a tremendous amount of money.'

Scaramucci immediately denied a rift with chief of staff Reince Priebus, comparing them to two brothers 'where we rough each other up once in a while.'

'I have no problem working for Reince. I con only speak about my management style, okay? I have been on Wall Street for 29 years. Nobody has ever worked for me, people work with me,' he said.

SEALED WITH A KISS: Incoming White House communications director Anthony Scaramucci, right, blowing a kiss after answering questions during the press briefing in the Brady Press Briefing room of the White House in Washington, Friday, July 21, 2017

TAKE THE LONG WAY HOME: Outgoing White House press secretary Sean Spicer walks down the steps of the Eisenhower Executive Office Building towards the White House, Friday, July 21, 2017, in Washington. Spicer abruptly resigned his position, ending a rocky six-month tenure that made his news briefings defending President Donald Trump must-see TV

ARE THESE THINGS ON? Scaramucci delivered a smooth performance where he declared his love for the president, denied a rift with the chief of staff, and announced the promotion of Sarah Huckabee Sanders

COULD BE WORSE: Outgoing White House Press Secretary Sean Spicer waves outside the West Wing of the White House in Washington, DC, USA, 21 July 2017

'I believe in a lot of collaboration. I think if you do that it's very, very empowering to people. I have no problem working for Reince, the president said I report to him directly. But listen, you guys are going to be very, very surprised about the relationship that I have with Reince.'

He said he would have walk-in privileges for the Oval Office, but didn't want to take up the president's time needlessly.

Scaramucci repeatedly praised the president during the briefing – picking up on a trail on online salutations that may have helped his job prospects.

'The president is the most competitive person I've ever met. I have seen this guy throw a dead spiral through a tire. I've seen him at Madison Square Garden with a topcoat on, he's standing in the key and he's hitting foul shots, swishing them. He sinks three-foot putts. I don't see this guy as a guy that is ever under siege. This is a very, very competitive person. obviously there's a lot of incoming that's coming into the white house. but the president's a winner,' he said.

HUG IT OUT: Anthony Scaramucci, incoming White House communications director, hugs White House press secretary Sarah Huckabee Sanders as he takes the podium at the daily press briefing at the White House, Friday, July 21, 2017, in Washington. White House press secretary Sean Spicer has resigned

He declared the White House 'on track' and called Trump one of the best politicians in history.

'But I think we are doing an amazing job. The president himself is always going to be the president. I was in the Oval Office with him earlier today and we were talking about letting him being himself, letting him express his full identity. I think he's got some of the best political instincts in the world, and perhaps in history. If you think about it, he started his political stent two years and two months ago. And he's done a phenomenal job for the American people. And the people I grew up with? Yhey so identify with the president and they love him. And so we're going to get that message out,' he said.

When Scaramucci got a question from DailyMail.com about Trump's low poll numbers, he claimed Trump was doing 'phenomenally well.'

'And so what I would say about polls is that they are a barometric pressure reading for right now today. but the american people are actually playing a long game. And I think they really, really love the president. And when you look into the individual state-by-state polls, you can see the guy is doing phenomenally well,' he said.

Asked about Trump's unproven claim that between three and five million Americans voted illegally, Scaramucci fudged but said the president is sometimes 'closer to the truth' than people realize.

'So if the president says it, let me do more research on it. My guess is that there's probably some level of truth to that. I think what we have found sometimes, the president says stuff, some of you guys in the media think it's not true, or it isn't true. It turns out it's closer to the truth than people think. So let me do more homework on that and i'll get back to you,' he said.

'THERE'S PROBABLY SOME LEVEL OF TRUTH': Scaramucci delivered a smooth briefing but said he'd have to 'do more research' on President Trump's claim that three to five people voted illegally

Sanders, in her first day briefing since her promotion, denounced 'Russia fever' and dodged a question about whether Trump would consider pardoning himself or his associates amid investigations of Russian election interference.

'The president maintains pardon powers like any president would but there are no announcements or planned announcements on that front whatsoever,' she said dryly.

Just like his first day on the job, the day Spicer told the president he was leaving was filled with chaos, intrigue, and a crowd of reporters clawing for information outside his West Wing door.

Spicer is vacating his position just six months after he first stood at the podium and made his controversial remarks about the size of President Trump's inauguration crowd

Scroll down for video

NO EXIT: Spicer barricaded himself inside his office after resigning his post Friday morning

ON-CAMERA BRIEFING: Reporters converged around the door separating the White House briefing room from the West Wing staff

Scaramucci surprised reporters by taking questions on the day it was announced he was joining the White House staff

Spicer managed to stay on the job for six months despite predictions for months that he was on the way out.

He delivered the news to President Trump Friday morning.

After his departure dominated cable news for hours, Spicer tweeted Friday afternoon: 'It's been an honor & a privilege to serve @POTUS @realDonaldTrump & this amazing country. I will continue my service through August.'

ABC news reporter Jonathan Karl tweeted Friday that he went to ask Spicer about the Scaramucci news and that Spicer 'slammed the door' in his face.

Another sign of tension: Spicer was not even present when Trump gave an interview to the New York Times Wednesday where the president lashed out at investigators. The only press aide present was long time press advisor Hope Hicks.

Spicer was furious about the slight, New York Magazine reported.

The New York Times was the first to report the news of Spicer's resignation.

Spicer tweeted that he will stay on until August

In what could be a declaration of independence, he called in to 'fake news' CNN's Dana Bash Friday afternoon as news was still sinking in and captivating the media.

'I can tell you that he did not sound upset when I talked to him. He sounded a lot like the Sean Spicer that we used to know,' Bash said on air.

'He wanted to give the president and the new team a clean slate. That that’s the answer that he is giving,' she said. Describing the resignation after talking to Spicer, she said: 'The president made clear that he the president wanted Sean Spicer to stay.

'He said he didn’t want to stand in the way from letting this happen from letting changes happen and that he felt in the moment that the time was right or the White House and the White House staff and also fro Sean Spicer personally,' she said.

NEW YORK, NY - OCTOBER 27: Deidre Scaramucci and Anthony Scaramucci attend "Hopping Over the Rabbit Hole" Anthony Scaramucci Book Party on October 27, 2016 in New York City. (Photo by Jared Siskin/Patrick McMullan via Getty Images)

Just before the news unfolded Friday, Spicer was barricaded inside his West Wing office. Chief of staff Reince Priebus and Scaramucci were outside. Deputy press aide Sarah Huckabee Sanders then sent reporters away just before the bombshell emerged.

Spicer is a longtime Republican operative who has been subjected to ridicule on Saturday Night Live for some of his strenuous efforts to defend the president.

He had already taken a major step back from public view. White House briefings in recent weeks have typically been held off camera, and mostly by his deputy, Sarah Huckabee Sanders.

Even Spicer's most recent briefing was conducted off camera.

White House press secretary Sean Spicer walks down the hallway during President Donald Trump's visit to the Pentagon, Thursday, July 20, 2017. White House Press Secretary Sean Spicer has resigned over hiring of new communications aide. (AP Photo/Pablo Martinez Monsivais)

MOCKED: Melissa McCarthy as White House Press Secretary Sean Spicer during "Spicer Returns" in Studio 8H on May 13, 2017 -- (Photo by: Will Heath/NBC/NBCU Photo Bank via Getty Images)

Spicer's tenure ended abruptly the same morning Trump brought in telegenic Anthony Scaramucci as communications director

Scaramucci enters the job having an existing relationship with President Trump. He is pictured with his wife, Diedre, as well as President Trump and first lady Melania Trump

Scaramucci gave a strong recommendation to his new boss

Scaramucci, like Trump, trumpets a strong belief in loyalty. He is pictured here with wife, Diedre

BRIGHT LIGHTS: Anthony Scaramucci and wife Deidre Scaramucci

His departure came after weeks of turmoil over the Russia investigation. Trump is also shaking up his legal team, as longtime attorney Mark Kastowitz steps back as head of the effort to defend him against Russia-related charges.

Spicer's resignation came hours after Trump legal spokesman Mark Corallo left his post after sources said he was troubled by the decision to start attacking special counsel Robert Mueller.

He released no immediate statement, but was scheduled to appear on Hannity on Fox News Friday night.

RESIGNED: Mark Corallo, who served as spokesman for Trump's legal team for about two months, abruptly resigned Thursday, amid reports he was concerned about efforts to tarnish special counsel Robert Mueller

Spicer had been filling in as acting communications director while maintaining his press secretary job following the departure of Mike Dubke, who cited personal reasons for his departure just a few months into the job.

Spicer's job was a challenge from Day One, when he sparred with reporters over the president's claims of the size of his inaugural crowd.

Spicer gained instant notoriety for making a claim that was easily contradicted by photographic evidence: 'This was the largest audience to ever witness an inauguration — period — both in person and around the globe.”

SIDELINED: Spicer's briefing duties were increasingly picked up by Deputy White House Press Secretary Sarah Huckabee Sanders and done in an off-camera fashion

THEY LET CAMERAS IN HERE? Live feeds shows reporters, but no sign of Spicer immediately after he quit

His abrupt resignation came as details were emerging about the process that led to the arrival of his new communications superior.

In typical Trump White House fashion, the hiring had involved multiple streams of information and influence, outside a direct chain.

White House adviser Jared Kushner, the president's son-in-law, put the plan to in motion, pushing hard for Scaramucci's hiring.

Chief of staff Reince Priebus was blindsided by the move and found out about it after plans were already in motion.

Spicer ran press for the RNC when Priebus was chairman during the 2016 election cycle.

Priebus told CNN he supported Scaramucci '100 per cent' – an indication that Priebus intends to try to keep his position.

Spicer had tense relations with the press during his rocky tenure

Although the move had been forecast for weeks, it stunned official Washington, as reporters swarmed the White House briefing room. In an image typical of Spicer's tenure, they crowded outside the lower press area and footage was carried on cable networks live.

Over months of his own political death watch, it often fell to Spicer to defend the president.

'I think the President is very pleased with his team and he has a robust agenda,“ Spicer said in late May after one of many reports of an imminent shakeup.

'Ultimately the best messenger is the President himself,' Spicer said. “He's always proven that he is the best messenger not just for what he wants to articulate but that the American people resoundingly chose him as their President – because he understands the frustrations and concerns and values of the American people and he is probably the best person to communicate that.'

The president was known to watch Spicer's briefings closely and had become heavily critical.

Lines of authority were also an issue. Under the situation that was about to take shape, Spicer would have been reporting by title to Scaramucci, who has no experience running a communications operation. Scaramucci's role would have been to be as a primary force on TV defending the president.

But with many of his briefing responsibilities also stripped away, Spicer's role would be greatly diminished.

Spicer and his deputy, Sarah Huckabee Sanders, increasingly in recent weeks deflected questions about Russia probes to the president's lawyers. They also sometimes steered clear of vigorous defenses, instead merely restating the president's view.

Scaramucci, meanwhile, has leapt into his emotive defenses of Trump, calling him a 'virtuous and honorable man' this month on Twitter. 'Virtue means the courage to act with integrity. Don does that everyday.'

He also tweeted he was 'proud to call him a friend,' adding: 'The truth is crystal clear. Will have your back always.'

White House Press Secretary Sean Spicer walks down the White House Colonnade after returning on the South Lawn by Marine One, with US President Donald J. Trump (not pictured) in Washington, DC, USA, 17 May 2017 (reissued 21 July 2017)

PILLAR OF THE MESSAGING OPERATION: Melissa McCarthy as White House Press Secretary Sean Spicer during "Spicer Returns" in Studio 8H on May 13, 2017

Melissa McCarthy as Press Secretary Sean Spicer during the "Sean Spicer Press Conference Cold Open" on February 11, 2017

Trump defended Spicer in an appearance on Jeanine Pirro's show on Fox – but seemed to vouch for his character more than his TV performance or way with words.

'He is a wonderful person — he is a nice man. ... He just gets beat up by these people," Trump said, referencing the press.

Trump met with Scaramucci at the White House Thursday at a meeting that included his daughter, Ivanka Trump.

Despite vigorously opposing Scaramucci being brought on, Prieubus told a White House communications staff meeting Friday that Spicer's departure would bring a 'clean slate,' the Washington Post reported.

Scaramucci and Spicer hugged, according to the paper.

Spicer's rocky tenure included numerous flubs and disputed factual claims, as he struggled to explain the president's often improvised agenda to a sometimes hostile media the president ripped as 'fake news.'

Beyond the crowd size claim, he apologized after referring to 'Holocaust centers' rather than concentration camps. Just last week he referred to the 'Majinsky Act' rather than the Magnitsky Act when describing the swirling Russia probe.

'I think he probably should have resigned on Day One' over the crowd size claim, former Hillary Clinton communications director Jennifer Palmieri told CNN, adding that Spicer seemed like a nice person.