Deus Ex Machina
An unexpected, contrived solution to an impossible problem that has not been set up or earned by the story.
Last updatedDeus ex machina (Latin for "god from the machine") originally referred to the practice in ancient Greek theater of lowering an actor playing a god onto the stage via a crane to resolve an otherwise unsolvable plot. In modern usage, it describes any resolution that appears out of nowhere, without foreshadowing or logical setup, to rescue characters from an impossible situation.
The Eagles in The Lord of the Rings are a frequently debated example, with many arguing they constitute a deus ex machina at the end of Return of the King. A clearer example is the ending of H.G. Wells's The War of the Worlds, where the invincible Martians are killed not by human effort but by terrestrial bacteria. Spielberg's film adaptation of War of the Worlds keeps this ending, and it remains divisive.
Deus ex machina is considered a storytelling flaw because it violates the implicit contract between author and reader: that the resolution will grow from the story's established elements. To avoid it, ensure that every solution is either foreshadowed, earned through character action, or emerges from previously established rules. If your protagonist cannot solve the problem, the problem may need to be redesigned.