White House press secretary Sean Spicer resigned from the White House Friday after President Trump hired financier Anthony Scaramucci to take over as communications director.

Spicer's resignation came shortly after Scaramucci, a Wall Street financier and former transition official, met privately with the president Friday morning and accepted the top job in the White House press shop. Spicer had been filling that role informally since May, and deputy press secretary Sarah Sanders had slowly transitioned into being the main presence at the daily briefing.

Spicer announced on Twitter that he will remain at the White House through August.

A Republican close to the White House who spoke to Spicer Thursday evening told the Washington Examiner described the move as an "Ivanka Trump play," and said that Trump wanted to bring in Scaramucci, whom friends and colleaguers refer to as "Mooch," to hold the title of communications director but not perform all the duties that the role typically requires.

Scaramucci would take the prestigious communications director title "but would not be fulfilling that responsibility because he doesn't know how," the source said.

"Basically, Trump wanted to give Scaramucci something to do because he thinks he's a 'good Italian kid'," the source said, noting that the decision to hire Scaramucci was based partly on the Trump supporter's performance defending the president on television.

Trump liked the idea of bringing in a surrogate to promote his agenda on cable news.

Bryan Lanza, former campaign official and transition spokesman, told Washington Examiner that Spicer was the "wrong hire in January" and noted "it's time to turn the page" on the White House's messaging strategy.

"The president desrved a top tier White House communications shop and Scaramucci is top tier," Lanza said.