It's a dark twist, but comedy sketches sometimes end with a character (or all of the characters) dying. Here are four examples, from "Saturday Night Live" to "Key & Peele." (Nicki DeMarco/The Washington Post)

The “Key & Peele” sketch starts small: Just two guys complaining about their wives, who are in another room, out of earshot.

One swears he said to his wife — who told him to be in the car by 6:45 when she didn’t even get out of the shower until 20 minutes after that — “I looked this woman in the eye, I said . . . ”

His voice drops to a whisper as he says a word he never really called her, because no man in his right mind calls his wife a — well, you know.

The guys relocate to the basement, as the other friend relates a my-wife-is-infuriating story that ends with: “I looked my woman in the EYE SOCKETS. I told my woman straight out. I said it! I said — ”

But the wives interrupt, so the men seek even more secluded locales: first a tree in the yard, then a field in the middle of nowhere. Finally, ridiculously, they’re in a rocket ship, and Peele’s character ejects himself into space. His voice echoes out into the ether — “I said biiiii . . . ” — as he floats away to his certain death in the abyss.

“You’ll notice in ‘Key & Peele,’ one of the outs that continuously comes up is somebody either sacrificing their life or getting killed,” Jordan Peele said by phone, reflecting on the five seasons — that’s 298 sketches — he and co-creator Keegan-Michael Key wrote, produced and performed. (All of which are now available to watch free on Comedy Central’s website.)

It’s not just “Key & Peele.” Plenty of “Inside Amy Schumer” sketches devolve into suicide sprees or cannibalism. On “Saturday Night Live’s” May season finale, a “Dead Poets Society” parody came to a bloody conclusion when Pete Davidson got gruesomely decapitated by a ceiling fan.

Sketch comedy allows for this kind of finality: The three or four minutes are up, and you’ll never need to see these characters again, so why not get rid of them for good? “If you come out of a sketch background, you’ve written a lot of sketches where people explode or their heads fall off,” said Jay Martel, executive producer of “Key & Peele.”

But the real reason so many sketches end at The End, said Peele, is because “the highest heighten of life, really, sort of keeps rearing its head. Which is death. Which is the ultimate absurdity of this existence, in a way.”

Is there a best way to end a comedy sketch? Endings — or outs, or buttons as writers call them — are notoriously difficult to nail. The ideal ending needs to be satisfying and surprising while staying true to the comedic game that preceded it. It must contain the one line after which nothing else could possibly be said. An ending that doesn’t deliver that sense of closure, or that arrives a minute too late, sucks the funny out of the whole scene.

You want “to build it to a crescendo where the last joke is a great joke,” said Tim Herlihy, who wrote for “Saturday Night Live” from 1993 to 2000. But plenty of sketches take too long or just never get there; surely you’ve seen SNL bits that seem to exist in an alternate, slow-motion timeline where endings never materialize.

“People who don’t do this for a living, they’re satisfied when they see a sketch with a good ending and they feel completely dissatisfied when it doesn’t have one,” Martel said. “You don’t hear people, the next day at work, talking about how ‘it was a good sketch, but I just didn’t like the ending.’ It’s just ‘it wasn’t a good sketch.’ It’s by far the hardest thing about writing sketches. It’s often what separates a good sketch show from a mediocre sketch show.”

Why is this the most burdensome element of sketch writing? “If you’re writing a five-act play or a movie, you’ve got all these strands you can put together in satisfying ways,” Martel said. “But with a sketch, it’s the equivalent of stopping a car on a dime. You have to stick the landing and make it satisfying on a lot of different levels. And, obviously, you want to get the biggest laugh of the sketch, too.”

Oh, one more thing: You want it to “completely surprise [the audience], and turn their expectations upside down,” said Martel — but not by abandoning all the material that came before it. “We talked a lot at ‘Key & Peele’ about, you’re zig-zagging, and what is that last zag that nobody’s expecting?”

One of the first “Inside Amy Schumer” sketches to go viral was Season 1’s “Compliments.” A group of women deflect each others’ kindness in increasingly self-effacing ways — “Look at your cute little dress!” “Little? I’m, like, a size 100 now . . . I look like a whore locked out of her apartment” — until one of them accepts the flattery with a gracious and perky “Thank you!”

Horror music rises and everyone around her immediately — and very graphically — kills themselves.

That ending, so perfect for the plot it feels as though the sketch was reverse-engineered, was actually a placeholder that the writers kept meaning to change until it was too late to come up with something new, said Jessi Klein, the show’s head writer. But once it was locked in, it felt right.

The theme of “Compliments” and sketches like it, Klein said, is “women’s buried self-hatred. So it did feel like the ultimate conclusion of that emotion is that they would always get obliterated in some way.”

By the last 30 seconds of a sketch, Klein said: “You ask, what is this really about? What is the emotional conclusion that would occur if this behavior or situation were to just keep going, even though we’ve only been observing it for three minutes? Generally, in comedy, you’re observing things that are sort of ridiculous or annoying or, in some ways, pretty dark.

“A lot of them tend to end with an explosion of id,” Klein said. “And a lot of it can be a reflection of how the writers are feeling. ‘Oh, my God, this is hard. Let’s just kill something.’ ”

Comedian Rob Huebel used to have a sketch show on MTV called “Human Giant” with Aziz Ansari and Paul Scheer. “We killed each other a lot,” he admitted. He recalled one sketch, “Carpet Monkey,” in which the actors played the trio behind Three Brothers Carpeting who employed a monkey mascot who would literally “shoot down prices” with a pistol in their ads. This totally flawless business model fell apart when the chimp shot and killed Ansari’s character. At the end of the sketch, an edited graphic fills the screen: “Two Brothers Carpeting.”

“Comedy, at its core, is a surprise,” Huebel said. “And that’s what, technically, creates the physical reaction in you, just like [with] a horror movie: You have a visceral, physical reaction.”

This thesis holds, even when your target audience is 5-year-olds. Joey Mazzarino, who wrote for “Sesame Street” for over 20 years and was head writer for his last eight, says that every sketch in the series needed a button. “Norman Stiles [a former head writer of ‘Sesame’] pounded it into me: ‘If you don’t find a button, you’re throwing it out,’” he said.

Children, like adults, appreciate that “comedy is violent . . . Jon Stone, one of the big creators of ‘Sesame Street,’ would say, ‘When in doubt, throw a chicken.’ Because the violence of throwing a chicken into something [worked]. Jim Henson [had] characters blow things up all the time or eat each other.”

Do what you will with this eternal truth: “Seeing another person blow up is funny,” Mazzarino said. “That kind of peril, I guess it is a real part of our genetic code, to laugh at that.”

The best ending Herlihy ever wrote at SNL was not really the work of Herlihy. It was the work of a camel.

At the end of one of Tracy Morgan’s “Brian Fellow’s Safari Planet” sketches, Morgan was supposed to give his little “that’s all the time we have!” send-off. But a camel got in his way, which of course turned out to be funnier. “Whenever an animal misbehaves, that’s the best ending you can have,” Herlihy said.

At SNL, there are a handful of cheats, like talk shows that always end with a catchphrase (“Party on, Garth!” “Party on, Wayne!”) or a surprise celebrity cameo. If you’re lucky, your sketch will be picked to be the cold open, and then “no matter how bad the ending is, you get to end on, ‘Live from New York, it’s Saturday Night!’ ” Herlihy said. “You can’t lose with that.”

But there’s no great ending for a sketch that’s weak from the start. “When the sketch is kind of flawed to begin with, [and] it’s really just a sketch built around one joke — I’m talking at SNL, a four-to-five minute sketch, and you’ve kind of already got the joke by two minutes in, and they’re limping to the finish line — there’s no ending to be had with those,” Herlihy said.

“A sketch isn’t just five minutes of jokes,” said Jo Miller, head writer of “Full Frontal with Samantha Bee.” “It has a point. Even if it’s not a satirical point, or earth-shattering, there’s a reason you did the sketch. Make your point, go away.”

Kay Cannon, veteran of the “30 Rock” writers’ room and screenwriter of the “Pitch Perfect” movies, agreed that getting the ending right is about crafting a proper joke from the get-go. Improvising taught her “to understand the idea of a game in a scene . . . [and] understanding a scene’s structure, obviously, will help you with a beginning and middle and end.”

It’s that emphasis on construction — the cutting of the inessential, the calibrated build to a climax — that gives a sketch its zippy, fleet feeling. “There’s no magical length for a comedy bit, as John Oliver’s show has proven,” Miller said. “As long as it’s structured in a way that’s funny, that has a build, that takes a viewer on a path, a 20-minute bit can keep you laughing.”

Keegan-Michael Key, left, and Jordan Peele. (Ian White)

So it’s established that it’s tough to end a sketch. Maybe that’s because of the audience? We want to be shocked, but we want to feel intelligent. We want to know what’s going on but not know what’s coming next.

“What can go wrong with sketch . . . is that the audience gets ahead of you,” Peele said. “[As you] continue to give your audience a surprise and something new, you also want to simultaneously let your audience figure out what’s going on. You want them to feel smart, in a way. So you give them enough for them to do the math of the sketch themselves. Once the audience understands the comedic game, you have to . . . heighten it past where they think the next heighten is going to be,” Peele said. “You heighten once, twice, and the audience goes, ‘I know where the third one is going,’ but you heighten to the fourth, fifth, or sixth step, instead of what would be the expected next step.”

And maybe that’s one more reason why so many sketches spiral off into absurdity, or total annihilation. If you’re playing along with the game of the sketch, you are still, as an audience member, operating within the framework of that sketch. So the only way to catch a savvy viewer off-guard is to pull something in from outside the frame, to go beyond.

“Some people point out that [‘Key & Peele’] has this strong sci-fi fantasy element running through it, and I think a lot of that has to do with finding an ending,” Martel said. “Because sometimes you can’t find one in this world. You have to sort of take the leap into another world in order to pull it off.”