Sean Spicer resigned from his role as the White House press secretary on Friday.

In a tweet, Spicer said he would continue to serve through August, noting it’s been “an honor & a privilege” to work under President Donald Trump.

It's been an honor & a privilege to serve @POTUS @realDonaldTrump & this amazing country. I will continue my service through August — Sean Spicer (@PressSec) July 21, 2017

Glenn Thrush of The New York Times reported Spicer resigned after Anthony Scaramucci was named White House communications director on Friday. Spicer reportedly expressed his objection to the appointment of Scaramucci to Trump before announcing his intention to leave his role.

CNN reported Spicer said he “wanted to give the president and the new team a clean slate.” ABC and the Times said Trump did not ask for Spicer’s resignation.

Scaramucci announced during Friday afternoon’s press briefing that deputy press secretary Sarah Huckabee Sanders will take over Spicer’s role.

Spicer’s messaging frequently clashed with that of President Donald Trump. Trump most recently contradicted Spicer’s Jan. 31 explanation that the president’s controversial executive order on immigration was not a “ban.”

“I am calling it what we need and what it is, a TRAVEL BAN!” Trump tweeted on June 5, days after a major attack in London prompted him to renew his call for the Supreme Court to reinstate the order to bar citizens of six majority-Muslim countries from traveling to the U.S.

Spicer’s tenure was marred with questionable moments, including a struggle with White House messaging on the firing of FBI Director James Comey on May 9. At one point, Spicer hid among some bushes to avoid answering journalists’ questions about Comey’s firing.

CNN reported the next day that Trump and his team had monitored Sanders’ performance at the White House daily press briefing, where she filled in while Spicer fulfilled his U.S. Navy Reserve duty.

WH sources: Highest levels incl. POTUS evaluating Sanders subbing for Spicer in briefing room. Last night an "embarrassment.. disaster." — Jim Acosta (@Acosta) May 10, 2017

Spicer was tapped to be Trump’s press secretary in December 2016. Before that, he worked as chief strategist and communications director for the Republican National Committee.

He had a rocky start to his run as press secretary when on Jan. 21, one day after Trump’s inauguration, he held a last-minute press briefing in which he ripped the media for accurately reporting that Trump had fewer people attend his swearing-in than former President Barack Obama did in 2009. He accused members of the media of engaging in “deliberately false reporting” and refused to take questions.

Spicer’s war with the media continued throughout his time in the White House press office. In February, he blocked several news outlets, including CNN and The New York Times, from attending an off-camera press briefing. In March, he was criticized for telling senior journalist April Ryan to stop shaking her head.

In April, Spicer claimed Nazi leader Adolf Hitler never used chemical weapons. Spicer went on to refer to the gas chambers used to kill millions of Jews as “Holocaust centers.” He later sent a clarification on his remarks that he revised three separate times.

Spicer used his position to spread falsehoods and repeat unverified claims made by Trump, including accusations of widespread voter fraud and claims that Obama had ordered wiretapping of Trump’s team during the 2016 presidential election.

Spicer was famously portrayed by actress Melissa McCarthy on NBC’s “Saturday Night Live.” This bothered Trump, who didn’t like that a male member of his staff was being portrayed by a woman, according to Politico.