Photo-Illustration: Maya Robinson/Vulture and Netflix

The House of Cards writers were in the middle of crafting the final chapters of the show’s operatic showdown between President Claire Underwood and her estranged husband, former President Frank Underwood, when their real world collapsed. Co-showrunners Melissa James Gibson, Frank Pugliese, and the show’s five writers had been convening at their New York office since June 2017. They had finished writing 9 episodes and outlined 11 out of the 13 overall. While they hadn’t figured out how exactly the epic power battle between Claire (Robin Wright) and Frank (Kevin Spacey) would conclude, they were close. About 200 miles away in Baltimore, the first two episodes of the final season had been filmed. A powerful woman was the leader of the free world, and though it was fictional, there was a heightened energy on set because of it.

The writers were still debating one crucial detail — which Underwood would be left standing at the end of the season? — when rape and sexual assault allegations against Harvey Weinstein broke in the New York Times and The New Yorker in October. As news alerts buzzed on their phones daily, the writers wondered what other high-profile figure would tumble next. Three weeks later, BuzzFeed broke the news that Star Trek Discovery actor Anthony Rapp had accused Spacey of making unwanted sexual advances toward him in 1986, when Rapp was 14. The stunned writers, accustomed to working in isolation, were aware of every painful development in the news. “It was very surreal because, at the time, it was the very beginning of the #MeToo movement which was influencing our story and [within it,] what it was like to be president and female,” story editor Sharon Hoffman said. “Writers’ rooms are usually very insular; it’s an intimate, familial place in the best circumstances. But the bubble was broken.”

In less than a week’s time, more than a dozen men had accused Spacey, the two-time Oscar winner, of sexual assault, sexual harassment, and attempted rape. Netflix halted production on the series immediately. By November 3, the streaming giant cut all ties with Spacey, and the future of Netflix’s signature drama was in limbo. Supervising producer-writer Jerome Hairston described working in a “fugue state.” Story editor Tian Jun Gu, who started out on the show as a writer’s assistant in the third season, remembers how rattled the group was by the uncertainty, and how angered they felt by the notion that one man’s actions could topple the show and erase their hard work. It was a “gut punch,” Pugliese said, but the prospect of tossing out five months of work and having to rebuild the season without the show’s corrupt central figure actually emboldened him and his partner. “It felt so unfair to the story, in a way, we had to defend the world of the show,” Gibson said. Wright, who is also an executive producer on the show, agreed. “It was very important to all of us to keep the show going,” she said. “For the fans. To close out the story in full, the way we had always intended.”

The fifth season had ended with Claire’s total rejection of Frank and her declaration to viewers: “My turn.” For months, the story the writers were building around Claire was that of a female president confronting misogyny head-on and enduring hit after hit from the patriarchy, including death threats. Gibson thought it would be especially “perverse” for the story of a woman in power to be denied because of the actions of a man. “On a meta level, it just didn’t seem right to let things happening outside the show […] end the series that way,” Pugliese said.

Co-executive producer Jason Horwitch had traveled to Los Angeles for his wife’s birthday the weekend that Rapp’s accusations were published. Horwitch was preparing to leave for the Baltimore set for production on the third episode, which he had written, when Gibson called him and said, “Don’t get on the plane.” He knew what that meant. On the other side of the country, the showrunners met with Netflix and MRC, the studio that produces the show, to figure out next steps. Spacey was out, but was House of Cards over? “There was an idea to shut everything down for a while just to process everything that had happened and give it its due process,” Pugliese said.

The following day, Gibson and Pugliese gathered the writers to try to motivate them to conceive of a new season, without Frank Underwood — despite the possibility that their work could ultimately be in vain. “We were trying to keep the energy alive,” Gibson said. “We were trying to maintain creative momentum and be ready for any possibility.”

Before they returned to the story, the group spent one day catching up on the news and sharing their feelings. “There was a really strong bond created between all of us, not just from the writers’ room experience, but because of going through this very specific and surprising experience because of Kevin Spacey,” Gu said. Several of the writers mentioned being impressed with how calm and caring their bosses were. “There was no sense of panic,” Hairston said. “There was just a sense of processing it.” Hoffman coped by buying chocolate babkas from different bakeries every day and taste-testing them with her colleagues. “I have this very specific memory of toasting chocolate babkas and buttering them and eating them. Like a lot,” supervising producer-writer Charlotte Stoudt recalled. “We were indulging the sweet tooth, but at least it didn’t get more dire than that,” Hairston added with a laugh.

It didn’t take long for the room to get back to work. “We have no control over the machinations outside of our room,” Hoffman said. “The only thing we can control is the story. There was not much else to do at that point.” Horwitch was allowed to stay in Los Angeles with his family for the month of November; he would call in for four to six hours a day to break stories with his colleagues. “There was a lot of momentum going forward,” Gu said. “We knew what was riding on a new season being re-broken by us. There were 400-plus people that were working on it, the audience expectations, and our desire to get out the message that one man was not going to decide our fate. We wanted to end it as dignified as possible.”

The season of House of Cards written before the Spacey revelations revolved around Claire coercing Frank into giving her a divorce. Frank would retreat into the background as he fought to keep his hold on the Oval Office with the help of two new characters, the Shepherds, sibling corporate Republican power brokers (played by Greg Kinnear and Diane Lane) modeled after the real-life Koch brothers. With their money and influence, the Shepherds controlled Frank Underwood’s White House. But they couldn’t control Claire’s; the season would have pitted Frank against Claire until the bitter end.

Although the winner of that battle had not been determined, many scenarios were being considered. Hoffman was rooting for Claire; Gu says he was hoping for a scenario in which both Underwoods won, and America was left the loser. “That felt right for our times,” he said. “To see the horrors play out in their victory would have been interesting without being too moralistic.”

Gibson and Pugliese said they were allowing the fluid process of production, and even consulting with cast and crew, to help them find their denouement. “There were many discoveries along the way as we were shooting, but it was going to be a mighty battle for the narrative,” Gibson said. “We were in the middle of it,” Pugliese added.

Ultimately, Netflix announced on December 4 that it would move forward with a shortened final season, with 8 episodes instead of the usual 13. The writers were relieved to hear the news, but they also felt anxious about the compressed schedule. Even though they’d been breaking the new version of the season for a month, they now had to quickly write the scripts so that production could restart a month later.

The first question they tackled in the Spacey-less version was how to explain Frank’s absence. The former president had undergone a liver transplant last season, and there had been talk on the show of the dangers of not taking his medicine properly. But an accidental death seemed too convenient, Gibson said. If he just disappeared, well, that would seem silly. The writers quickly decided he had to be killed, but there were many options for how he would die, and even more for who would take his life. After all, everyone hated Frank Underwood.

“Claire snuffing out Frank with a pillow over the face,” Horwitch said. “An act of God, or karma, hit by a train, or an air conditioner falling out of the sky. These were all just flights. We pretty quickly settled on poisoning of some kind. There was something cathartic about imagining his demise, all the blood on his hands. At some point, we went through every living character in the show and considered how and why they might waste Frank. It always came back to Claire and [Doug] Stamper.”

In many ways, he was a better antagonist dead than alive.

Although on the show the public is told that Frank died of an accidental overdose while sleeping next to Claire, she lets viewers know early in the season that he actually died on the floor of his bedroom in the White House, and that she suspects he was murdered. What really happened to Frank isn’t revealed until the final moments of the show, a decision the writers made so that Frank’s death could linger over everyone and everything in the season. “You couldn’t say he died and then let it just sit there,” Stoudt said. “Who killed the FU of it all — who wouldn’t want to play that and to watch that? To have him haunt everyone makes you wonder who’s guilty, who does it benefit?”

By the end of the series, Claire has killed almost every major player that gets in her way, but it turns out she did not murder Frank. In the last minutes of the finale, Doug Stamper (Michael Kelly), Frank’s most loyal servant, confesses to Claire that he poisoned Frank with an overdose of his own medications. Why? To stop him from murdering her in the White House and ruining his legacy. “This is Frankenstein, the creation myth, the monster killing his maker,” Horwitch said.

The producers told Kelly that he was the killer while he was on set filming the penultimate episode. For weeks, the writers had debated whether it would be Claire or Doug; occasionally, producers updated the actors on the conversations. “There had been so much talk, all these huddles, like, What if this happens? What if that happens? But I remember when they told me, it made all the sense in the world,” Kelly said. “Doug would go to any [end] to protect Frank, to protect his legacy and all they had worked for. He was saving him from himself. Hearing it, it was one of those feelings, like it almost gave me butterflies.”

“Certainly if I was Claire, I would have killed him,” Hoffman said, with a laugh. “There were good reasons for both to do it.” But in the end, they felt Doug had the better motive.

One element that didn’t change from the original version of the season was Claire’s revelation that she is pregnant with Frank’s child, having used his sperm for IVF, despite their distance before he died and the fact that she had previously had three abortions. The pregnancy was Gibson’s idea. The writers embraced it immediately, as it served dual purposes for Claire in the new version of the season. Not only did it solve the problem of Frank’s will — without an heir, his entire estate would go to Doug — it also created new, softer optics for a president who was under constant siege in her first 100 days in office.

“It’s typical Claire Underwood,” Gibson said. “It’s tactical. She’s weaponizing motherhood.” But on the flip side, Pugliese added, “I think she gets surprised by how much she’s affected by it.”

Although the season had always been designed to be Claire-centric, now there was an opportunity to delve more wholly into her interior life without the intrusion of her overbearing husband. “The specter of Frank was better than Frank,” Hoffmann said. “He’s haunting the show, which kind of mirrored what was happening in real life.”

“By design and [through his] performance, Francis Underwood took up so much oxygen,” Stoudt added. “Once he resigned, his story was essentially over. In many ways, he was a better antagonist dead than alive.”

Even so, in Frank’s absence, the show needed a new, living antagonist. “We had to come up with a worthy rival for Claire,” Horwitch said. Naturally, Stamper seemed like the best choice here, too. He was the only person who knew the worst of Frank’s and Claire’s dirty secrets, and his blind devotion to Frank’s memory threatened her position.

In the final scene of the series, Doug suggests to Claire that she name her child Frances Underwood. But then he makes the mistake of telling Claire that Frank “made her” and, indirectly, asks her to pardon Frank posthumously. Things quickly go south when Claire rejects the idea and tells him to admit he’s happy Frank is dead. Doug angrily pokes Claire in the neck with a letter opener, accidentally cuts her, and apologizes. But she turns the letter opener on him, stabs him in the abdomen, and covers his nose and mouth as he’s lying in her lap. In the writing process, Gibson and Pugliese envisioned the moment as a pietà. After he takes his last breath, Claire’s last words on the show — “There, no more pain” — echo what Frank said when he put a dog out of its misery in the first season.

“The last scene with Michael felt like the perfect way to end the series; Claire does it out of mercy,” says Wright, who directed the finale. “Claire and Doug have been rivals since the beginning, and it seemed only right that they would face off one last time with only one of them surviving.”

Claire and Doug’s blood in the final moments of the show marks the first time the series made prominent use of the color red. (The show is predominantly filmed in yellows and blues.) “Claire and Doug are two characters that have managed their emotions for many seasons for the sake of whatever their objectives were — for the pursuit of power,” Pugliese said. “Robin and Michael both thought the final scene needed to be more emotional and less verbal than anything we’ve seen before. And the red punctuates the scene and helps us to break from everything we’ve been accustomed to doing on the show up until that moment.”

The scene in the Oval Office was the last one filmed for the series. Everyone on set became emotional as Doug took his final breath. When the assistant director yelled the final “Cut!” after a 14-hour day, Kelly and Wright laughed and hugged. “Nobody wanted to leave,” Pugliese said. “People hung around until daybreak. It’s bittersweet, ‘cause you’re leaving people you’ve worked with intensely for many years. It’s a group of people that collectively got together, put their head[s] down, and worked as hard as possible to finish this series in the best way possible. We got there.”