Deus ex machina ( , ; plural: dei ex machina; English "god from the machine") is a plot device whereby a seemingly unsolvable problem in a story is suddenly or abruptly resolved by an unexpected and unlikely occurrence. Its function is generally to resolve an otherwise irresolvable plot situation, to surprise the audience, to bring the tale to a happy ending or act as a comedic device.

Origin of the expression

Deus ex machina is a Latin calque . The term was coined from the conventions of ancient Greek theater, where actors who were playing gods were brought on stage using a machine. The machine could be either a crane (mechane) used to lower actors from above or a riser that brought them up through a trapdoor. Aeschylus introduced the idea and it was used often to resolve the conflict and conclude the drama. The device is associated mostly with Greek tragedy, although it also appeared in comedies.

Deus ex machina

Ancient examples

Aeschylus used the device in his Eumenides but it became an established stage machine with Euripides. More than half of Euripides' extant tragedies employ a deus ex machina in their resolution and some critics claim that Euripides invented it, not Aeschylus. A frequently cited example is Euripides' Medea in which the deus ex machina is a dragon-drawn chariot sent by the sun god Helios, used to convey his granddaughter Medea away from her husband Jason to the safety of Athens. In Alcestis the heroine agrees to give up her own life to spare the life of her husband Admetus. At the end, Heracles appears and seizes Alcestis from Death, restoring her to life and to Admetus.

Deus ex machina

Aristophanes' play Thesmophoriazusae parodies Euripides' frequent use of the crane by making Euripides himself a character in the play and bringing him on stage by way of the mechane.

Deus ex machina

The device produced an immediate emotional response in Greek audiences. They would have a feeling of wonder and astonishment at the appearance of the gods, which would often add to the moral effect of the drama.

Modern theatrical examples

Shakespeare uses the device in As You Like It, Pericles, Prince of Tyre, and Cymbeline. John Gay uses it in The Beggar's Opera where a character breaks the action and rewrites the ending as a reprieve from hanging for MacHeath. During the politically turbulent 17th and 18th centuries, the deus ex machina was sometimes used to make a controversial thesis more palatable to the powers of the day. For example, in the final scene of Molière's Tartuffe, the heroes are saved from a terrible fate by an agent of the compassionate, all-seeing King Louis XIV — the same king who held Molière's career and livelihood in his hands.

Plot device

Aristotle was the first to use a Greek term equivalent to the Latin phrase deus ex machina to describe the technique as a device to resolve the plot of tragedies. It is said by one person to be undesirable in writing and often implies a lack of creativity on the part of the author. The reasons for this are that it damages the story's internal logic and is often so unlikely that it challenges the reader's suspension of disbelief.