Sarah Sanders will take over as White House press secretary after Sean Spicer resigned his post earlier in the day, incoming White House communications director Anthony Scaramucci said Friday.

"I'd like to announce formally that Sarah Huckabee Sanders is going to be the press secretary," Scaramucci said.

Scaramucci made the announcement after Sanders introduced him to the White House press corps. Scaramucci said he would start in a few weeks, and Spicer, who has been serving as the interim communications director, said he would stay in his current job through August.

"I think it's probably, certainly professionally, one of the greatest honors that any person could ever have to work in any capacity within this building, and to get to do that up here in such a public way and speak for the president is absolutely an honor and something I will cherish and hope to do my very, very best every single day, and be as open and transparent with you as humanly possible," Sanders said. "And we'll always work to operate at the highest level and certainly with the most amount of integrity as you can."

News about Spicer's resignation came soon after Scaramucci had been announced as the new chief of the White House communications shop. A Republican source close to the White House told the Washington Examiner that Trump wanted Spicer to stay on as press secretary, but that he declined the offer.

Scaramucci had previously been working as senior vice president and chief strategy officer of the Export-Import Bank since mid-June. A former Goldman Sachs executive, he had been a top candidate to join the administration after Trump's inauguration, having served as a economic adviser during the transition period.

White House chief of staff Reince Priebus and chief strategist Steve Bannon were reportedly against Scaramucci's hiring, although Scaramucci downplayed the "tension" between the two top White House hands.

Sanders previously served as the principal deputy press secretary and has been conducting the vast majority of White House briefings in recent weeks, both on and off-camera.

Scaramucci said that he has not spoken to the president about holding "regular" on-camera briefings but plans to speak with him in the future.

"The answer is we may," he said after being asked about the topic. "I have to talk to the president about that. I like consulting with the president before I make decisions like that."