Spicer disagreed with Trump’s decision to hire Scaramucci for the role and refused the president’s request that he stay on, the New York Times reports.

The White House has been embroiled in a constant mix of scandal and crisis for months, with rumors swirling that Trump was considering a staffing shake-up at the highest levels of his administration. Spicer’s name often appeared at the top of the list of administration figures in doubt, but persevered despite numerous embarrassing moments, including a brief bout “among” the White House bushes.

Scaramucci, meanwhile, has enjoyed a more distant relationship with the administration, serving as one of the president’s loudest and most dogged defenders on cable television.

Spicer confirmed his resignation on Twitter, writing he would hold his position through August.

It's been an honor & a privilege to serve @POTUS@realDonaldTrump & this amazing country. I will continue my service through August

Sarah Huckabee Sanders, who regularly filled in at press briefings for the gaffe-prone Spicer, will take over as White House press secretary. Sanders read President Trump’s statements on Spicer’s resignation and Scaramucci’s new role as communications director.