Created by a bunch of Greek drama geeks who didn't know how to properly end a play, a "deus ex machina" is a literary device where a protagonist is saved from an ostensibly hopeless situation by an abrupt and/or contrived solution. Literally translating to "God out of the machine," a deus ex machina can be a character, like or "THE CLAW" from Toy Story 3, or it can even be an item, like the "Deus Ex Machina" labeled treasure chest from Dodgeball. Given the over the top nature of superheroes, dei ex machina are frequently utilized.

Mind you, Dei ex Machina aren't always necessarily a bad thing. Oftentimes, they can provide a well-deserved happy ending, like the T-Rex suddenly showing up at the end of Jurassic Park. Alternatively, one can also allow a work to just sort of end, like the military suddenly showing up at the end of Jurassic Park III. Regardless, we've assembled 25 examples of dei ex mahina hailing from superhero films, shows and comics, ranging from "ridiculous" to "that's 26 pages of our lives we'll never get back." We only have a few rules for this listicle. First, the deus ex machina had to save a heroic character or protagonist. So, contrived coincidences that get a hero into further trouble – like every usage of Kryptonite, ever – do not qualify. Second, even though "it was all a dream/simulation/fear gas hallucination" twists count as a type of Deus Ex Machina, we will only be considering entries where a deus ex machina saves the day. Get ready to suspend your disbelief.

25 THE VEGAN POLICE

Scott Pilgrim vs. The World

While severely losing the fight against Ramona's Akira-level psychokinetic ex-boyfriend Todd Ingram in Scott Pilgrim & The Infinite Sadness, Scott loses hope: "I need some kind of...like...last minute, poorly-set-up Deus Ex Machina!"

As you're probably well aware, Todd's psionic abilities are due to his veganism, obviously. Yet, Todd still indulges in gelato. Suddenly, The Vegan Police burst in, removing Todd's powers with the De-Veganizing Ray for "veganity violation." Scott then head-butts Todd so hard that he bursts into a bonus life. Demonstrative of the objective dopeness of this Deus Ex Machina, The Vegan Police are one of the few elements in this volume that remain in Edgar Wright's film adaptation, Scott Pilgrim vs. The World.

24 COULD IT BE... SATAN?

Ghost Rider #9 from 19873 claims to contain "three of the most unexpected endings of all!" and it doesn't disappoint. Satan has tricked Rocky Simpson into renouncing her protection over Johnny Blaze, enabling Satan to revoke Blaze's powers. Ostensibly nothing can stop Satan from claiming Johnny Blaze's soul, yet a bearded stranger begs to differ: "Johnny Blaze's only sin was despair – and that is not sin enough to condemn him to your domain...He has earned his second chance." Defeated, Satan goes back to Hell.

While the stranger claims that he is "a friend," writer Tony Isabella originally intended Him to be Jesus Christ. The friend was changed into Mephisto's illusion, probably because having a superhero incarnation of Jesus is somewhat "problematic."

23 DEADPOOL'S MAGIC MIRROR

Spider Man Deadpool mashup weird world

The psychopathic Deadpool/Spider-Man mashup Itsy Bitsy has stormed Deadpool's clubhouse in Spider-Man/Deadpool #10, thoroughly thrashing our heroes. As Itsy Bitsy prepares to detonate a hundred pounds of C4, Deadpool asks Spidey if he has a healing factor, only to be met with explosions. Two issues later, we discover that Deadpool and Spider-Man escaped via a magic mirror that transported them to the pocket dimension of Weird World.

Since time moves significantly faster in Weird World, Deadpool has days to nurse Spider-Man back to health, while only half a day has passed on earth. Basically, it's Marvel's version of The Hyperbolic Time Chamber. "That was incredibly convenient," notes Spider-Man. Deadpool concurs: "Yeah, don't pull at the plot thread too hard."

22 THE LAST WILL AND TESTAMENT OF CHARLES XAVIER

Prof. X in The Last Will and Testament of Charles Xavier

When Charles Xavier originally wrote his will – placing the dangerous Omega-Level mutant Matthew Malloy under Cyclops' care – there's no way Chuck could've known that Matthew would end up skeletonizing the X-Men. Anyway, Eva Bell goes back in time in 2015's Uncanny X-Men #31 to have Professor X psychically make Matthew's parents never meet. Xavier then erases his memories of the encounter, with no repercussions whatsoever.

Telepathically reading Eva's mind, Celeste reads ours as well: "That is the worst idea one of us X-Men has ever had! And I'm including the total existence of Adam-X in that." For you non-X-Men nerds, understand that was an Omega-Level burn. Seriously, Adam-X's mutant power is just being the worst.

21 A HAPPY ENDING

Fantastic Four A Happy Ending

After The Thing dies from Doctor Doom related shenanigans, The Fantastic Four use Doom's heaven machine to meet God, who is Jack Kirby, in Fantastic Four #511. Technically, God isn't literally Fantastic Four co-creator Jack Kirby. God is just Jack Kirby from the Fantastic Four's perspective. It's like that movie Contact, except Jack Kirby gets a call mid divine intervention from Stan Lee, God's collaborator.

Jack Kirby pencils in the plot by erasing Reed's face-burns before redrawing/resurrecting Ben Grimm as The Thing. God explains: "You were going to wake up in Reed's healing tank, anyway. I just condensed your subplot a little." Parting ways, Jack Kirby gives Marvel's first family a sketch of an older Fantastic Four – "A happy ending."

20 SAVING LIGHT

Bat Signal Gotham Central

The G.C.P.D. are interrogating a kidnapper who claims he will only reveal his victims' locations to The Batman in Gotham Central #36. The problem is that the police department's Bat-Signal was destroyed. Fortunately, the department just so happens to have a portable Bat-Signal in storage. It's like that movie Contact... again. This superior Bat-Signal emits a laser beacon, summoning Batman.

Evidently, Ted Kord had gifted this Bat-Signal to the G.C.P.D. years back, but the city council had considered the gift to be inappropriate, placing it in storage. Considering that the kidnapped victims' lives were on the line, every second mattered. As Detective Josie notes: "Pretty convenient that this one is so easy to set up."

19 THE DEATH OF NAMOR

Namor the submariner 37

Namor fights the pagan sorcerer-warrior-prophet-king Suma-Ket over the usurped throne of Atlantis in 1993's Namor The Sub Mariner #37. Tridenting Namor, Suma-Ket fulfills his destiny with "the death of the final heir of Neptune."

Coincidentally, Ocean-Daddy Neptune appears, freeing Namor's allies before resurrecting Namor. Neptune interfered because Suma-Ket's profane religion was encroaching upon Neptune's presence as Atlantis' major deity. So, Poseidon makes Namor his champion, even restoring his foot-wings and giving him the sacred (read: tacky) Armor of Atlantis, bearing more shoulder pads than a 1980's Warhammer 4000 figurine. Looking more like a rip-off of Aquaman than ever, Namor proceeds to easily defeat Suma-Ket.

18 THE WHITE LANTERN

The White Lantern last panel of Blackest Night

Black Hand rips out the five hearts of a Guardian in order to summon The Entity, the avatar of life itself, in Blackest Night. Black Hand's master Nekron intends to vanquish The Entity – a god that The Guardians conveniently chose to never mention before now – in order to wipe out reality. Hal Jordan crashes into The Entity however, automatically enlisting every hero into the White Lantern Corps, whose restoration powers make quick work of the undead Black Lanterns.

After exploding Nekron in one shot, The Entity distributes rings to resurrect all of DC's best dead intellectual properties, including super-dead guys like Deadman and The Anti-Monitor. Basically, The Entity performed a soft reset on the DC Universe.

17 MILK WARS

Trapped in Retconn's home office, Cave Carson smashes open a vending machine to wolf down as many salads as possible in Milk Wars. Cave pukes; however, his vomit congeals to form Swamp Thing! Swampy catches Cave up on the plot, mentioning that Cave had ingested Swamp Thing before Cave drank the mind-altering Milk.

Unsure of how to free Retconn's comatose prisoners, Rita Parr, Wild Dog and Cave smoke Swamp Thing to trip out and formulate a solution: Unplug the prisoners, then have Swamp Thing compost their corpses for a fertilizer bomb. Finally, Swamp Thing flies our heroes out on wooden wings. In retrospect, Clay was super lucky that vending machine was stocked with just salads and not Milk, or Milk Plus.™

16 SUPER NOT OKAY

superman and lois (2)

Pete White pushes his employees Clark Kent and Lois Lane under the mistletoe in 1963's Action Comics #306. Disappointed, Lois wishes that she were kissing Superman. Insulted, Superman retaliates: "I'll teach this minx a lesson! I'll shock the daylights out of Lois by giving her a super-kiss!" After locking lips, Lois feels dizzy, her most recent memories erased.

The super-kiss is an anti-Kryptonite, a plot-device that creepily bails out Superman. For example, Superman knocks out a crowd of teenage fans with the super-kiss after his alias of DJ Clark The "K" is compromised in 1966's Superman #182. Likewise, Superman makes Lois forget his secret identity with a kiss at the end of Superman II.

15 THAT GREEN CRYSTAL FROM SUPERMAN II

Superman III Movie

Speaking of  Superman II, Superman only gets his Deus Ex Machina powers from another Deus Ex Machina. Superman uses the crystal chamber and its red sunlight rays to remove his powers "forever" to hook up with Lois Lane. Meanwhile, General Zod and Phantom Zone homies are doing some hoodrat stuff. Anyway, Superman's hologram-mom warns him, claiming "Once it is done there is no return."

Apparently Superman's mom was being dramatic, because Superman restores his powers (and then some) with a green crystal. Rejuvenated, Superman resets the status quo by beating Zod and erasing Lois' memories from this entire movie with a kiss. On the other hand, this green crystal also gives Superman that useless transparent Superman-emblem, so maybe it balances out.

14 THE MIRACLE MACHINE

With reality, time and the multiverse itself converging onto a single point, hope and narrative structure are abandoned as Darkseid brings about the end of life itself in Final Crisis. Before Superman falls out of the 31st century, Brainiac 5 shows him The Miracle Machine, "a machine that turns thoughts into things." With a single glance, Superman memorizes the schematics of the machine, tasking everyone available to help build it.

So, what does this literal God-Weapon do? Superman explains: "It's taken all of our resources, the accumulated knowledge and expertise of a whole culture, to make the Miracle Machine. One chance, one wish." Only on the penultimate page of Final Crisis do we learn what Superman wished for: "He wished for a happy ending."

13 DOOM PATROL

Robot Man vs Dan Scram the final evolution of man Doom Patrol Gerard Way

Doom Patrol has come across "Dan Scram and his Gravity Pirates!" in 2016's Doom Patrol #7 by Gerard Way. Desperate, Dan Scram crams down some Uma jelly with a hearty "Get bent!" The jelly transmogrifies Scram into "the final evolutionary step of man." Fortunately, from his pockets The Chief produces protein bars that morph the team into the natural predator of evolved man – Psychic Werewolves, obviously.

Finally, Chief uses a reversion ray to reset the status quo while riding a Xbox controller. As ridiculous as it sounds, it's all a tongue-in-cheek homage to classic Silver Age Doom Patrol comics, complete with a mustachioed gang of villains, sci-fi nonsense and a convenient Deus Ex Machina to wrap up the plot.

12 TONY STARK SAVES HIMSELF

Iron Man saves Himself

Tony Stark is comatose after the events of Civil War II, partly due to his fight with Captain Marvel, but mainly due to the experimentation that Tony had performed on his own body. Super-doctors like Hank McCoy don't feel comfortable operating on Tony's unordinary biology, so they leave him in a coma and hope for the best. Weeks later, Tony suddenly respawns.

Albeit hairless, Tony is in stellar medical condition, as his experimentations allowed him to heal from what would have otherwise have been a lethal injury. Tony figures that this was a one shot bonus life. Yet, Tony replicates the process with minimal effort in resurrecting Rhodey – who had died weeks ago in Civil War II – with no medical complications whatsoever.

11 IRON MAN THE ANIMATED SERIES

Iron Man The Animated Series

The Mandarin has mutated a submarine's worth of Russian sailors into radioactive zombies to fight Iron Man and Force Works in "And The Sea Shall Give Up Its Dead" from 1994's Iron Man: The Animated Series. After beating the Mandarin and his henchmen/roommates, Iron Man and the Force Works team still have to deal with the irradiated zombies.

Apparently, "zombies" are a bit of a misnomer, as Century – Force Works' resident techno-wizard – just uses his staff to instantly turn the radioactive zombies back into sailors. Century could have just used this spell at any time to wrap up the plot in seconds, making the brawl that was the bulk of this pilot episode totally unnecessary in retrospect.

10 THE MINIATURE PARACHUTE OF RICK JONES

Rick Jones undergoes a transformation during Marvel's What If..? series

Peter David admits to writing himself into a corner with 1990's The Incredible Hulk #375 in Writing for Comics with Peter David. Despite having Hulk and Betty Ross successfully escape a Skrull saucer before it explodes, Rick Jones remains on the ship.

With only three panels of comic book time, Peter David saves Bruce Banner's best friend with a beautifully dumb Deus Ex Machina: The saucer explodes. Suddenly, Rick Jones floats down in a parachute, wielding an explanation: "Don't look so shocked. I always carry a miniature parachute with me in case I have to jump from an exploding Skrull saucer." All Bruce can say is "That's... that's ridiculous." Rick counters that Bruce is the ridiculous one: "Why? I needed to, didn't I?"

9 SECRET EMPIRE

Barf vomits a Cosmic Cube fragment in Secret Empire

One of the most pivotal moments in Secret Empire is Sam Wilson successfully wielding a fragment of the Cosmic Cube, turning the tide of battle with its wishing powers. We learn precisely how Sam retrieved this cosmic shard in Captain America #25, where Sam and company come upon an inhumane Inhuman prison break.

The prison break was due large in part to Brian McAllister, or Barf, who has the ability to vomit up a perfectly replicated copy of anything – provided that it is to be used for altruistic purposes. After looking at an image of a Cosmic Cube fragment, Barf regurgitates a perfectly working fragment. Frankly, Tony Stark speaks for all of us when he exclaims: "You gotta be [expletive deleted] kidding me."

8 THE VAPORIZATION OF RED ROBIN

The Vaporization of Time Drake Robin Detective Comics

Surrounded on all sides by lethal Bat-drones, Tim Drake has accepted his fate in Detective Comics #940. We witness Tim go down in a barrage of lasers, as the issue takes a sullen turn. Tim Drake indubitably went out in a heroic blaze of glory, punctuated by Batman grieving with Tim's girlfriend Spoiler in a tearful embrace.

But yeah, no. Tim Drake isn't dead. While we saw Tim get vaporized, this was not due to robot-lasers, rather a teleportation ray. Tim wakes in a cell before a hooded figure who explains: "You were reconnecting threads that could not be reconnected. You're so loved, so deeply intertwined. It became crucial that we take you off the field." That's Tim Drake: too important to die.

7 ASTONISHING SPIDER-MAN/WOLVERINE

Wolverine doom planet

Astonishing Spider-Man and Wolverine is Marvel's version of Bill and Ted's Excellent Adventure: a time-travel romp powered by Deus Ex Machina. For starters, Spider-Man and Wolverine are saved from an extinction-level meteor by a random time skip. Even when Wolverine dies uses the conveniently discovered Phoenix Gun to destroy Doom The Living Planet, Spider-Man just resurrects Wolverine by first wishing for a functioning Cosmic Cube before cosmically wishing Logan back to life.

When our heroes are about to be burnt at the stake for witchcraft, Mojo pauses the story, revealing that he's been manipulating the narrative for better ratings. Given our love for Astonishing Spider-Man and Wolverine, we have to admit that Mojo knows what he's doing.

6 THE TINY HOUSE

Batman saves Robin with a Deus Ex Machina

Batman and Robin take inventory of The Trophy Hall, a museum housing mementos from Batman's cases, in 1950's Detective Comics #158 or "The Thousand and One Trophies of Batman!" When Commissioner Gordon gifts Batman a sarcophagus – which qualifies as tampering with evidence – Batman smuggles Dr. Doom (no relation to Marvel's Dr. Doom) into the Batcave.

Trapped, Dr. Doom sets a death trap by reactivating Batman's collection of death traps. After failing with a robo-dino, Dr. Doom tosses a grenade at The Dynamic Duo. Fortunately, Batman perfectly shields himself and Robin with the indestructible "midget mansion of the pee-wee people of tiny town," last seen in 1947's Batman #41, but coming completely out of nowhere in this issue.