WASHINGTON — Sean Spicer fought on two fronts each day: With the press and with President Donald Trump.

On his first day as press secretary just over six months ago, things got off to a memorable start when Spicer accused the press of "dishonesty" in covering Trump’s inauguration, incorrectly claiming the president had "the largest audience to ever witness an inauguration, period." At Trump's behest, he labeled the media "shameful and wrong" — for reporting the facts.

That set the tense and sometimes ugly tone for the remainder of his short-lived tenure as White House press secretary.

As the weeks and months went on, he was obviously out of step with his boss — both in substance and in style. At the outset, Trump reportedly didn't like Spicer's fashion sense, specifically bringing up his ill-fitting, light-colored suit jackets. The press secretary began sporting darker threads soon after.

The hits kept coming. Spicer insisted Trump’s legally challenged "travel ban" was not a ban at all. He found himself humbled after a briefing-room gaffe about Hitler overtook that day’s news cycle and required clarification and an apology. Spicer drew rebukes from female journalists and even Hillary Clinton after snapping at longtime White House reporter April Ryan to "stop shaking your head" during a heated line of questioning. And his mispronunciations of world leaders names, like Syria's Bashar Al-Assad, went viral.

Melissa McCarthy performs in a Saturday Night Live skit as White House press secretary Sean Spicer. NBC

Spicer's manner, gaffes, and claims made him a household name. His briefings, filled with hostile interactions with reporters, were must-see TV. He was mercilessly spoofed on NBC's "Saturday Night Live," where the parody became a sensation. Melissa McCarthy’s "Spicey" had an explosive temper, a moving lectern, a hatred of The New York Times and other outlets, and wads of chewing gum. Suddenly Spicer was a household figure, an amusing symbol of the Trump administration's permanent combat with the media.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Perhaps he could have survived his duels with the White House press corps. But not with the president.

In the early-morning hours came the presidential tweets, frequently detonating whatever messaging Spicer’s communications team had carefully set for the day ahead. Long-planned and scripted "theme weeks" about infrastructure or jobs were often upended by the president’s tweets about the latest revelations in the Russia investigation or random over-the-top attacks on the media and critics.

It was only after Spicer had quit on Friday that the president offered what was perhaps his strongest and most public praise of his former aide, calling him a "wonderful person who took tremendous abuse from the Fake News Media - but his future is bright!"

That was a stark contrast for a president who often contradicted his own spokesman's statements, contributing to the erosion of trust between the White House and the media. The most glaring instance came in the days following the president’s surprise firing of FBI Director James Comey, when Trump's account of the reasons behind his fateful decision ran counter to what Spicer had told reporters the night before.

And Trump laid the blame for scrambled messaging and contradictory explanations about Comey at the feet of his communications team, prompting grumbling from the press about whether Spicer was in the know and further damaging his credibility. The enduring image from the Comey debacle was Spicer ending up in the bushes outside the White House to avoid reporters’ questions.

"That was so bad last night," a White House official told NBC News at the time.

Reporters and White House watchers saw clearly the central and ultimately insurmountable problem that Spicer faced: Speaking on behalf of a president who believes he is his best spokesman, who thinks that no one else is up to the task, and who isn't afraid to remind the staff of it.

White House deputy press secretary Sarah Huckabee Sanders calls on a reporter during the daily press briefing on June 28, 2017, at the White House in Washington. Evan Vucci / AP

Post-Comey, Trump, according to sources inside and outside the White House, polled confidantes on their thoughts about Spicer’s job performance. And sources said Trump began to realize he had another option in then-Deputy Press Secretary Sarah Huckabee Sanders, who was named press secretary on Friday. That drove the president, as one person put it, "to consider whether or not it makes sense…to change the face of the administration."

And that face did begin to change. The White House more often banned cameras from the press briefings, sparking an uproar from the press. And Spicer was now infrequently at the podium, having been replaced by Sanders.

When he did make what turned out to be his final return to the podium earlier this week, a reporter commented: "We miss you, Sean."

"Well, I miss you, too," he pantomimed.

Traveling reporters knew that Spicer, a devout Catholic, had fallen from favor when he was excluded from the group of White House staffers given an audience with the Pope when the president was visiting Vatican City. Spicer's days seemed numbered. Trump was irked that the press briefings were getting such high ratings, and even that Spicer was portrayed by a woman on SNL. The question in the White House became not whether Spicer would be replaced, but when.

Spicer’s exit came after he had told confidantes that if Trump brought in Anthony Scaramucci as communications director, he would leave. Minutes after Spicer slammed the door in the face of a veteran reporter, news of his departure broke on Twitter.

Later Friday, Spicer appeared on Fox News to end his tenure much as he began it, complaining about media bias, accusing the press of being increasingly concerned with "their clip or their click than they are about the truth and the facts," and insisting, despite the distractions, that the White House had just had a "very successful" Made in America week.

Months in the wings watching Spicer’s follies paid off for Scaramucci, who gushed from the podium Friday about how much he loved and respected the president, how his policies were right for the country, and he preened about Trump’s media savvy and understanding of the voters. It was as if he’d learned the lesson that Spicer couldn't quite master: The person speaking to the American public and press on behalf of the White House is really playing to an audience of just one.