What Is Deus Ex Machina?
Quick answer: Deus ex machina explained: an ending rescued by sudden outside intervention the story never earned. Origin in Greek theatre, examples, and how to avoid it.
Deus ex machina, Latin for 'god from the machine', is a plot resolution in which a sudden, unearned intervention from outside the story's established logic rescues the situation: the cavalry no one summoned, the inheritance no one mentioned, the god lowered onto the stage by a crane. The name comes from Greek theatre, where actors playing gods were swung in by machinery to untangle the plot's knots. In modern criticism it is almost always an accusation: the ending arrived, but the story did not earn it.
The concept matters because it names the exact way endings fail most often. Not by being sad or happy, but by being imported. Readers will follow you anywhere except to a resolution that ignores every cause and choice the story spent its length establishing.
The longer answer: from Euripides to the writing workshop
Euripides used the crane freely; his Medea ends with the title character escaping in a chariot sent by the sun god, beyond all human justice. Even in antiquity this drew criticism. Aristotle's Poetics argues that resolutions should arise from the plot itself, and Horace advised that a god should not intervene 'unless the knot be worthy of such a deliverer'. The complaint is thus as old as the device: when heaven does the work, human choices retroactively stop mattering.
The modern definition has three tests, and a rescue must fail all three to deserve the label. Was the intervention established earlier in the story's world? Did any character's choice invite or enable it? And does it resolve the central problem, rather than a side one? An unplanted, unchosen intervention that dissolves the main conflict is deus ex machina; the same event planted in act one is merely a payoff. The sin is not the rescue but the missing setup.
Contested examples worth arguing about
H. G. Wells' The War of the Worlds (1898) ends with the invaders killed not by human resistance but by earthly bacteria. It looks like a crane from heaven, yet Wells plants biology throughout and aims the ending at his theme: humanity survives by luck of ecology, not merit, which is the novel's whole cold point. The eagles in Tolkien attract the accusation constantly; readers debate whether their rescues are established enough by Middle-earth's rules to count as earned.
William Golding's Lord of the Flies closes with a naval officer appearing on the beach, an arrival nothing on the island caused. Golding knew it, and made the rescue ironic: the officer saves the boys from savagery while himself waging war. These cases teach the useful nuance that an outside intervention can be defensible when it serves theme deliberately, but note how much argument each example still generates. Even done knowingly, the device spends reader goodwill.
How to keep gods out of your machinery
Diagnose first. Summarise your ending in one sentence beginning 'the problem is solved when...'. If the sentence's subject is not your protagonist, or something your protagonist set in motion, look harder. Then apply the standard repairs: plant the intervention early so it becomes payoff rather than rescue; convert luck into consequence by making a character's earlier choice cause the arrival; or, often best, let the protagonist fail and make the story about the cost.
The discipline pays doubly in short fiction, where there is no space to disguise a rescue. A 1,500-word story that ends on an uninvited miracle has spent its whole length building tension it then refuses to convert. Judges reading blind for structure and emotion, as Writory's five-part rubric asks, consistently mark down endings where the solution walks in from off the page; the fix is almost always one planted sentence in the opening scenes.
What deus ex machina is not
The term gets flung at any surprising ending, so precision is worth keeping.
What poets can take from this
- Write the sentence 'the problem is solved when...' and make sure your protagonist owns the verb.
- Plant any late rescue at least twice earlier, and attach it to a character's choice.
- If salvation must come from outside, aim it at your theme and accept the cost, as Golding did.
- Prefer a protagonist who fails honestly to one saved dishonestly.
- Audit your climax for arrivals: anyone or anything entering the story for the first time after the midpoint is suspect.
Try it yourself
Write two 600-word endings for the same story about a trapped miner: one where rescue arrives uninvited, one where a tool established on the first page and a choice made at the midpoint produce the escape. Give both to a reader and record which ending they remember the next day.
Questions
Why is deus ex machina considered bad writing?
Because it breaks the contract that consequences follow from choices. When an outside force dissolves the climax, every earlier decision retroactively loses weight, and the reader's investment is refunded in the worst way. The objection is ancient; Aristotle made it about Greek tragedy.
Can deus ex machina ever work?
Rarely, and only when the unearned rescue is itself the meaning, as with Golding's ironic naval officer or Euripides using divine escape to end Medea beyond human judgement. If you deploy it, do it visibly and thematically, and expect to spend goodwill.
What is the opposite of deus ex machina?
Critics sometimes say 'diabolus ex machina' for sudden unearned catastrophe. The true structural opposite, though, is the earned ending: a resolution produced entirely by established causes and the protagonist's own choices, which is what Aristotle asked of plots in the first place.
By the Writory editorial team, reviewed by working poets. Updated July 2026.
Enter a Writory poetry contest
Enter the August contest and have your own poem read and scored.