President Trump's legal and communications team saw a major shake-up Friday as the White House prepares for the potential expansion of special counsel Robert Mueller's probe into issues beyond Russia's election meddling, as White House press secretary Sean Spicer stepped down after a new communications director was brought in to take over Trump's messaging machine.

Spicer's resignation came shortly after Anthony Scaramucci, a 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 the White House's main presence at the daily briefing.

A Republican close to the White House who spoke to Spicer Thursday evening told the Washington Examiner that Trump tried to convince Spicer to stay on in his current role while Scaramucci took the title of communications director. Spicer declined, but will remain in the White House until August.

The communications director post taken by Scaramucci has remained vacant since Mike Dubke's departure in May. Dubke left the job after a brief tenure that saw the botched explanation of former FBI Director James Comey's firing and the appointment of Mueller as special counsel. Spicer has been filling the communications director role in the meantime.

The West Wing moves occurred just as Trump's outside counsel underwent a series of personnel changes.

Marc Kasowitz, the lead lawyer in Trump's outside legal team, has represented the president in the Russia inquiry since May. But Ty Cobb, a special counsel positioned inside the White House, began representing Trump last week, and Kasowitz's role has reportedly diminished since Cobb entered the West Wing.

That shift came shortly after Kasowitz was caught sending profanity-laced emails to a random person who had written him a critical message.

Kasowitz did not respond to a request for comment on Friday. But a source close to the legal team told the Washington Examiner that John Dowd, a veteran defense attorney who began representing Trump in June, will take the lead of the president's outside counsel, although the source described it as a "complete team effort."

In addition, Mark Corallo, who served as Kasowitz's spokesman, told the Washington Examiner that he resigned from the team on Thursday, although he declined to specify a reason. He stepped down amid reports of infighting over the growing scope of Mueller's investigation.

Trump himself may be a source of some of the growing pressures on the legal team. The president warned in an interview with the New York Times this week that he would consider efforts to expand the investigation to be a violation of Mueller's mandate.

Rumors of a broad staff shake-up have dogged the West Wing since Trump's turbulent first weeks in office. Although high-level officials such as chief of staff Reince Priebus, chief strategist Steve Bannon, and Spicer, have each been the subject of speculation that they could soon be on the chopping block, the Trump team has so far seen only one significant departure.

Katie Walsh, Trump's former deputy chief of staff, left the White House in the spring to join an outside group created to promote the president's agenda.

Al Weaver contributed to this report