Spicer tweeted that he will continue to serve through August.

Trump asked Spicer to stay in his role, but Spicer said appointing Scaramucci was a major mistake, The New York Times reported, citing a person with direct knowledge of the conversation.

White House press secretary Sean Spicer abruptly resigned Friday after opposing President Donald Trump 's appointment of Anthony Scaramucci as communications director. At a press briefing later Friday, Scaramucci announced principal deputy press secretary Sarah Huckabee Sanders will take over as press secretary.

Anthony Scaramucci, incoming White House communications director, left, follows new White House press secretary Sarah Huckabee Sanders into the briefing room at the White House, Friday, July 21, 2017, in Washington.

White House chief of staff Reince Priebus was said to have advocated naming Spicer as press secretary. The two worked at the Republican National Committee before joining the administration.

"I'm 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." Sanders said Spicer understood the president wanted to add new people to the team and felt like it was best for the team to start with a "totally clean slate."

Sanders confirmed Spicer will remain on during the transition. She read a statement from Trump at the press briefing.

After Spicer's resignation, Priebus said he supports Scaramucci "100 percent," according to news reports.

Scaramucci addressed the reported tension at the press briefing, saying he and Priebus have been personal friends for six years.

"We are a little bit like brothers where we rough each other up once in awhile, which is totally normal for brothers," Scaramucci said. "There's a lot of people in here that have brothers, so you get that. But he's a dear friend."

Scaramucci said Priebus was the first person he called Friday morning and the two had met beforehand. Scaramucci said the two are committed to getting the administration's message out.

"Listen, you guys are going to be very, very surprised about the relationship that I have with Reince and the closeness that we're going to have in terms of working to serve the president," he said.

Spicer's departure came six months into the Trump administration. His daily press briefings, often featuring tense exchanges with reporters, were frequently carried live on multiple networks. He was often ridiculed on NBC's "Saturday Night Live."

The tone of his tenure was set on his first full day as press secretary. At a Jan. 21 news conference, he verbally attacked the media and refused to take questions. He claimed they had spread "deliberately false reporting," including understating the size of the crowd at Trump's inauguration the previous day. He insisted that the crowd was "the largest audience to ever witness an inauguration — period, both in person and around the globe."

Spicer had taken over responsibilities as White House communications director after Mike Dubke resigned from the position in May. Reports swirled for months that Spicer would resign or be ousted.

Scaramucci is a former hedge fund star who has hosted the annual SkyBridge Alternatives (SALT) Conference. He is currently the U.S. Export-Import Bank's senior vice president.

Earlier Friday, a source close to the White House told NBC that Scaramucci met with Trump. In the meeting, Scaramucci was offered the role of communications director and accepted it, according to multiple reports.

When NBC asked one of its sources whether Trump would change his mind, the person said the president's mind was made up.

Priebus and top adviser Steve Bannon had resisted the appointment, NBC reported before Spicer's resignation became known. It said the two were kept out of the loop on the decision.

Sources within and outside the White House said Bannon had told Scaramucci he would get the job "over my dead body," according to NBC.



Scaramucci is a former CNBC contributor