Warning: Season 6 spoilers abound.

“Your words will disappear. Your house will disappear. Your name will disappear. All memory of you will disappear.”

With that—a prediction, a curse, a cold statement of fact—Sansa Stark, on Sunday night’s episode of Game of Thrones, said goodbye to Ramsay Bolton, her rapist and her emotional abuser and her political nemesis and her husband. And then she did the thing Ramsay had done to so many others, so many times before: She left him to be mauled, and then eaten, by his hounds.

Death by dog: It was a fitting ending for the character whom The Atlantic’s readers determined to be the actual worst on television, across shows and genres, and whom The New York Times also dubbed, without irony, the “Most Hated Man on TV.” As my colleague Lenika Cruz has noted, one of the challenges Game of Thrones’s creators have faced as they have attempted to create plot lines that marry literary merit and fan service was to kill Ramsay off—his death was almost inevitable—in a way that would offer a satisfying mix of karmic justice and audience catharsis. Ramsay has inflicted so much pain, on his victims and by extension on his TV viewers, that few things would seem quite appropriate to that task. “He confounds many of the rules that would usually apply to small-screen villains,” Cruz wrote, “so it’s unusually difficult to imagine a departure that would hit all the right storytelling notes.”

And yet: With the death Ramsay was ultimately given—particularly bloody, particularly painful, particularly degrading—Game of Thrones managed to give its worst character an ending that was, to the extent such things can be, fitting. This was not only because of the what-goes-around-comes-around mauling Ramsay endured at the hands (or, more precisely, the jaws) of his own weaponized beasts. It was also—and more so—because of the words Sansa sent him away with. Ramsay’s death was, in the end, not about Ramsay so much as it was about Sansa. A show that is deeply interested in its own portrayals of justice gave its audience an execution that was bloody and sticky and screaming and salivating; the scene got its gravitas, though, from the death warrant Sansa, Ramsay’s victim, read at its start. It was the scene’s words that gave it its moral heft.

“Catharsis” is a word fans often use to describe any visceral reaction to art’s external events; as it was first used by Aristotle, though—the English version comes from the Greek κάθαρσις—it suggests something more specific: “purging” and, through that, “cleansing.” And in many ways Ramsay’s death—one that was certainly designed to be cathartic for viewers—did indeed play out as a kind of extended purification ritual, both within Game of Thrones and beyond it. The killing took place in stages, each of them moving beyond the banalities of the revenge narrative and toward more civic, and indeed more cosmic, notions of justice. Rickon Stark played his part, by setting Ramsay’s battle plan in motion. Jon Snow’s soldiers played theirs. Sansa played hers, by intervening in the battle with the Knights of the Vale and allowing Ramsay to be captured. Snow played his, making good on his repeatedly expressed desire for hand-to-hand—which is to say, man-to-man—combat with Ramsay.

And yet it was, in the end, woman-to-man combat that did Ramsay in. Sunday’s show was one of the most overtly feminist episodes of recent Game of Thrones memory—with Daenerys, in Meereen, winning her own battles by way of aerial combat and making plans for the consolidation of her power—and Sansa’s plot line was a fitting climax to all that. Sansa fulfilled her role not just through political activities, through her alliance with Littlefinger; she was also the person who most directly brought about Ramsay’s demise. The show, in that sense, presented a vision of justice that was not just civic or karmic, but also warm and close and personal. In the end, it was Sansa and her abuser, alone again in a darkened chamber; in the end, though, it was Sansa making the decisions about who would be the victim.

Ramsay’s death was also in that sense a purification ritual for Sansa, the victim who is so much more than that. The Stark daughter didn’t kill Ramsay herself, in a Winterfellian version of Hammurabic justice; instead, she merely set in motion the circumstances that allowed him to be mauled. But the most cathartic thing of all in that ritual wasn’t the hounds, or the blood, or Ramsay’s cries of pain. It was her benediction-in-reverse. Through her narration of Ramsay’s death, Sansa doubled—and thus ratified—her abuser’s demise, ensuring that his death would be not just physical, but spiritual. If humans can enjoy a measure of immortality through the memories they leave behind, Sansa’s last act was to inform her abuser that he could expect no such extended life. All memory of you will disappear.

With that—by thinking beyond bloody action, and paying attention to the power of words—Game of Thrones managed to find an ending for Ramsay that was satisfying both to fans (judging by all those Purina dog chow memes) and to the show’s more literary ambitions. Justice was served, to Ramsay but also, much more importantly, to Sansa. The show did that by minimizing Ramsay’s death even as it was taking place—by framing it not just as the end of Ramsay’s story, but also as the continuation Sansa’s. Earlier in the season, Sansa had found some preemptive catharsis by reciting to Littlefinger some of the horrors she’d endured at Ramsay’s hand. She read, essentially, her own victim statement. But Ramsay’s death suggests Sansa’s new life: Freed of him, finally, she will be a victim no more.