Sean Spicer at a June 2 press briefing at the White House. In a few short months he became the most famous White House press secretary in history. Was it worth it? (Jabin Botsford/The Washington Post)

So what does happen when you tie your career to Donald Trump?

In the case of Sean Spicer it meant getting everything he ever wanted: a dream job at the press secretary’s podium, name recognition that dwarfed that of many of the politicians he once worked for and, perhaps most important, a slice of the Beltway’s most coveted real estate — his own place in the Know.

But wishes come true at a price in the Trump administration. For Spicer, that meant a loss of credibility from inflating inauguration crowd sizes, picking petty fights with the press and a rabid “Saturday Night Live” parody portrayal that will be remembered long after this administration comes to an end.

Spicer seemed to be able to live with all these humiliations, but losing his spot in the inner sanctum was too much to bear. Spicer resigned Friday after learning that hedge-fund veteran Anthony Scaramucci would be hired as communications director, a move the press secretary had argued against.

“The president wanted to bring on some folks,” Spicer said in an interview with The Washington Post. It was “better to give them an opportunity to have a clean slate and evaluate what we’ve done. To figure out what’s working and what needs to be improved upon.”

Spicer was magnanimous on his way out, thanking the president for giving him the “unbelievable honor” of the job he’d always wanted, and noting that he would continue to serve in the position through August for a smooth transition.

But some maintain that serious damage has been done to his reputation.

“He was willing to defend every heinous act and every lie,” said Tim Miller, a former spokesman for Jeb Bush and a one-time Spicer colleague at the Republican National Committee. “But not work with the Mooch. That tells you everything you need to know about Spicer.”

Last July when I spent time with Spicer at the Republican National Convention in Cleveland, the stocky firecracker of a flack was famous-for-D.C. and on his way to national stature. As the communications director and chief strategist for the RNC, he had a reputation as a classic operative: someone who might schmooze with some members of the press and ream out others, who seemed to be at every establishment shindig, and had the very Washington hobby of filling his home with political memorabilia. He was, in other words, a real-life character straight out of HBO’s “Veep.”

“Sean is the person that taught me about message discipline,” Reince Priebus, Spicer’s longtime boss, told me last summer, when both were still at the RNC. “He taught me not to react in a knee-jerk fashion, that you don’t need to do every interview or swing at every pitch.”

The first day I was with Spicer, I saw his philosophy of message discipline up close when he went viral for defending Melania Trump’s apparent plagiarism of a Michelle Obama speech by noting that similar words had been uttered on the cartoon “My Little Pony.” The next day he admitted to me that he swallowed two-and-a-half packs of Orbitz gum every day by noon — a detail shared with me by a friend of his, which I completely expected him to deny. Instead of being embarrassed, Spicer seemed, at least publicly, to revel in the attention.

“It changed the conversation,” he told me about the “My Little Pony” defense.

After Trump chose him to be his press secretary, Spicer continued changing the conversation. He came out, a fire-and-brimstone preacher in an ill-fitting suit, to say, despite all evidence to the contrary, that the president had “the largest audience to witness an inauguration, period.” Before you knew it, SNL was commissioning a giant stick of gum for Melissa McCarthy to devour in her outrageous skit parodies of Spicer press briefings.

Later, Spicer raised more than a few eyebrows when, in an effort to highlight the brutality of Syria’s Bashar al-Assad, he noted erroneously that “not even Hitler” used chemical weapons during the Holocaust. His badgering daily press briefings soon earned ratings competitive with popular soap operas. In his most meme-able moment ever, he insisted on conducting a press briefing in the darkness of the White House lawn, on the grim night that Trump fired FBI director James B. Comey, after huddling with his staff among the bushes.

The chattering classes had their punching bag, and die-hard Trump supporters had another hero. And Spicer, who was known to brag about his “Q score” to visitors, got his name recognition.

Spicer had nothing to be embarrassed about, he said when I talked with him in November, as long as his wife and kids weren’t embarrassed by him. When I asked him Friday if he had any regrets, he said: “None.”

But what about what comes next?

“Hopefully we’re midway through the book of my life,” Spicer said, adding that this most-recent chapter could be called “Exciting Times.”

For most press secretaries, the job opens the door to a lifetime of sinecures: lucrative speaking circuits, punditry gigs and, yes, books deals. But in the case of Spicer, perhaps the most damaged person to ever leave the post, well — actually, it might be exactly the same thing.

“Are you kidding me,” Miller said. “Spicer’s going to be a multimillionaire. There is going to be a bidding war.”

On this point, Spicer might agree.

“I’m sure there will be plenty of opportunities,” he said.

And that tells you everything you need to know about Washington.