It could have been a mission impossible, but “Archer” pulled it off.
In the FXX show’s Season 12 finale Wednesday night, the animated spy comedy closed the episode with a heartbreaking farewell to beloved New York actress Jessica Walter, who died unexpectedly in March at age 80. For the run of the show, Walter played hard-drinking, acid-tongued spy boss Malory Archer, mother of the show’s bumbling, self-centered namesake, secret agent Sterling Archer (voiced by H. Jon Benjamin).
The series was renewed for a 13th season, which left showrunners particularly challenged by the “Arrested Development” star’s passing.
“With respect to Jessica’s privacy, we only learned she wasn’t returning to ‘Archer’ shortly before she passed,” executive producer Casey Willis said in a statement to The Post. “We had to go back and alter the episodes we hadn’t completed with Jessica and wanted to end the season with a scene that honored her.” (The network declined to elaborate on what specific changes were made this season.)
Wednesday’s tear-jerking farewell kicked off when Malory’s “dearest Sterling” opened a letter from his mother — who disappeared following a mission — and read it, with a shaky voice, to his fellow spy agency colleagues.
“Do you remember what I told you on your very first day of training? You probably don’t, but it was ‘Always know where the exits are.’ And with all the chaos and confusion of late, I thought I would fix to make my own exit, in my own time, on my own terms and in a way that I could never be found by my enemies, or all my lovesick paramours who are literally countless,” the note read before caustically adding, “so I’ve decided that it’s time to pass the torch; try not to burn yourselves with it.”
The retirement letter then took a particularly poignant turn in light of Walter’s passing.
“And I know my decision may be abrupt, but we don’t always get to choose the perfect moment,” it continued. “Take care of yourselves, especially you, my Sterling, because from wherever I am, I’ll be watching over you. Love, Mother.”
Willis told The Post that the season’s storyline “did not originally involve Malory retiring.”
From there, the scene cut to Malory relaxing on a beach, cocktail in hand, alongside her husband, Ron Cadillac, who asked, “And how is my lady love?”
She responded, “Infinitely better now,” and they were seen from behind, watching — hand in hand — as the sun set over the ocean.
However, her touching final scene offered yet another level of poignancy. In early seasons of “Archer,” Ron Cadillac was voiced by Walter’s real-life husband Ron Leibman, who died in 2019 — and his actual voice was repurposed for the beach scene. According to a series rep, Floyd County Productions — the animation studio behind the show — “carefully curated” his lines from prior episodes to help build the final tear-jerking scene with Walter, who in 2017 described her character as a “hard-tough nosed dame” in an interview with The Post.
The beach sequence then faded to a tribute card reading “In Loving Memory of Jessica Walter” before the closing credits rolled — with the sound of beach-lapping surf and gently crashing waves replacing the show’s usual energetic theme music.
The eight-episode 13th season of “Archer” will premiere sometime in 2022.