Long before he became a senator, Al Franken was a liberal hero for the way he stuck it to Republicans. And so it was perhaps inevitable that, even as he resigned from the Senate in disgrace this week, he couldn’t resist a parting shot.

“I of all people,” Franken said on the Senate floor, “am aware that there is some irony in the fact that I am leaving while a man who has bragged on tape about his history of sexual assault sits in the Oval Office, and a man who has repeatedly preyed on young girls campaigns for the Senate with the full support of his party.”

It was a line of reasoning worthy of President Trump: Why am I being persecuted while my political enemy goes unpunished? How is that fair? Franken didn’t apologize — in fact, he cast doubt on his accusers — and the only regret he expressed was for “having to walk away from this job.” But after a political career premised on exposing the depravity of Republicans, Franken himself stood exposed. For years, he had built his brand on always being in the right. Even as he relinquished his Senate seat, he couldn’t let go of his sense of moral superiority.

Franken’s sudden fall came, as they so often do, when he seemed to be at his political peak. After winning reelection easily in 2014, he entered his second term on a head of steam. This year, he published a best-selling memoir, “Al Franken: Giant of the Senate,” and was even getting buzz as a potential presidential candidate.

It was a heady rise for the former comedian, a founding writer for “Saturday Night Live” who rose to fame with his portrayals of such indelible characters as the self-affirming Stuart Smalley. After 15 seasons of SNL, he quit when he didn’t get the “Weekend Update” anchor job and started focusing on political humor. His first book, “Rush Limbaugh Is a Big Fat Idiot and Other Observations,” was a No. 1 bestseller and vaulted him to a new kind of stardom. When he toured the country to promote it, he was mobbed by grateful liberals. “Thank you — it’s about time somebody took these guys on,” they gushed, as he recounts in the new book.

Franken quickly became a hit on the Democratic fundraising circuit. He wrote more books — “Lies and the Lying Liars Who Tell Them: A Fair and Balanced Look at the Right” got him sued by Bill O’Reilly — and launched a show on the liberal talk-radio network Air America. His reassuring refrain to the left-wing base, delivered with intelligence and humor, was always the same: Our guys are right, and theirs are wrong. The media’s insistence on fairness, Franken insisted, was itself unfair, because one side was good and the other was evil. And lying.

In 2006, Franken began preparing to try his own hand at being a candidate, largely because he believed the sitting senator, Republican Norm Coleman, was a jerk. His celebrity would not be an asset in the campaign. Focus groups of Minnesota voters recoiled from Franken’s off-color past (one woman, reading that Franken had once called Republicans “shameless dicks,” initially assumed it was a typo for “ducks”). But they were pleasantly surprised to hear he had written books and gone to Harvard — “the first recorded instance of it being a good idea to tell people you went to Harvard,” Franken notes. So the campaign emphasized this local-boy-made-good narrative and downplayed — or really, mercilessly squelched — his humor.

Revealingly in retrospect, the campaign’s biggest controversy was Franken’s history of jokes about sex. In 2000, he had written a satirical article for Playboy entitled “Porn-O-Rama,” about a fictitious place called the “Minnesota Institute of Titology.” And in the mid-’90s, brainstorming lines for a sketch in which Norm McDonald played Andy Rooney, Franken suggested Rooney might find a bottle of sedatives and say, “I give the pills to Lesley Stahl. Then, when Lesley’s passed out, I take her to the closet and rape her.” The line was intentionally beyond the pale, meant to help the other writers along, but it was immortalized in a magazine article about the writing process. In the line the writers ended up using instead, Rooney said he’d spiked Mike Wallace’s drink and taken nude pictures of him.

The controversy over these jokes rankled Franken, who didn’t think the attacks were fair in the context of the comedy world. “To say I was sorry for writing a joke was to sell out my career,” he wrote. But to save his candidacy, he sucked it up and apologized. On Election Night, Barack Obama won Minnesota by 10 points, while Franken and his Republican opponent were separated by only a few hundred votes. The ensuing recount lasted eight agonizing months.

Franken assumed office in July 2009, in time to give Democrats the 60th vote they needed to pass Obamacare — a supermajority that would vanish just six months later, with the loss in Massachusetts that prefigured the Tea Party wave to come. As for Franken, mindful of his near miss, he took care to establish himself as a serious senator. He refused to engage at all with the national media and never made jokes in public — any eruption, he knew, would trigger a rash of “Senator Yuk-Yuk” stories. He channeled his energy instead into ruthlessly aggressive questioning in committee hearings. “Maybe I wasn’t allowed to be funny anymore,” he writes in “Giant of the Senate.” “But I could still let my id out once in a while by eviscerating some right-wing jerk.” In the Trump era, Franken’s eviscerations of Cabinet appointees frequently went viral, bolstering his legend.

Franken’s hard work paid off with his 10-point reelection win in a tough year for Democrats. Secure in having finally won over Minnesota, he finally started letting it all hang out. In “Giant of the Senate,” he writes with remarkable frankness his history of drug use, the inside story of his campaigns, and the indignities of serving in the Senate: to alleviate the boredom of constantly calling donors, Franken composed a musical in his head. He also expresses astonishment at past pols felled by sex scandals, such as Eliot Spitzer and Gary Hart. “How could these guys risk everything that they’d worked for like that?” Franken writes. “How could they live with themselves after letting so many people down?”

Franken is popular with his Senate Democratic colleagues, and when the first allegations of sexual misconduct against him surfaced three weeks ago they generally deferred to him. But after the eighth accusation came to light, they began to turn against him. Franken did not go easily. The Democratic leader, Chuck Schumer, reportedly privately urged Franken to step down for the better part of a day; it was only when that didn’t work that he joined the public chorus of more than half Franken’s fellow Democrats.

Franken’s resignation speech on Dec. 7 was laced with bitterness and denial — the defiant valedictory of a man who still believes he is always right. His previous statements of remorse, he insisted, should not be construed as “admitting to doing things that in fact I haven’t done.” He added, “Some of the allegations against me are simply not true. Others I remember very differently.” A prominent Minnesota Democrat who believed Franken should have stepped down earlier said the senator appeared, even now, to be looking toward his political future. “I got the sense he’s going to find a way to come back,” the Democrat said. “He’s going to be out raising money for Democrats again in a couple of years.”

The fall of Franken and another prominent Democrat, Michigan Rep. John Conyers, would seem to show that sexual misconduct knows no political party — that structural sexism, human sin and the temptations of power affect all manner of men. But Franken, who staked his career on a one-sided monopoly on the truth, couldn’t see it that way. Even in disgrace, he could only see the fault of his opponents.

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Molly Ball at molly.ball@time.com.