Friday morning, White House press secretary Sean Spicer resigned, ending his six-month tenure in the position. His resignation came shortly after New York hedge fund manager Anthony Scaramucci accepted the position of White House Communications Director.

Why did Spicer resign?

According to CNN, Spicer warned President Trump against appointing Scaramucci, claiming that doing so would be a mistake. Following Scaramucci’s acceptance of the position, Spicer promptly resigned, even though the president requested that he remain as press secretary.

"It's been an honor & a privilege to serve @POTUS @realDonaldTrump & this amazing country.

I will continue my service through August,” Spicer tweeted soon after his resignation. White House officials were reportedly shocked by Spicer’s sudden decision to resign.

Spicer was not the only one who was opposed to Scaramucci’s appointment as communications director. Reince Priebus, White House chief of staff, claimed that Scaramucci did not have the appropriate political or organizational experience for the position. Previously, when President Trump attempted to offer Scaramucci the position of director of the office of public liaison, Priebus intervened, citing Scaramucci’s overseas investments as being potentially problematic.

However, Scaramucci’s appointment was backed by the president’s daughter Ivanka Trump, his son-in-law Jared Kushner, and Commerce Secretary Wilbur Ross.

Sanders set to be new press secretary

After news of Spicer’s resignation broke, it was initially unclear as to who would replace him. However, in a White House press conference Friday afternoon, Spicer’s deputy press secretary Sarah Huckabee Sanders was confirmed as the new White House press secretary.

The New York Times reports that Spicer’s resignation may have been a long time coming.

The former press secretary often felt “blindsided” by President Trump and his comments. The most recent incidence of this came when the president questioned his appointment of Attorney General Jeff Sessions in an interview with the New York Times. Growing tired of the president’s comments about his performance, Spicer has recently turned to holding off-air briefings, a tactic that is extremely controversial.

During Friday’s press conference, CNN reports that new White House communications director Anthony Scaramucci stated that “maybe” on-camera briefings will be brought back.