A deus ex machina (Latin for “god from the machine”) is a dramatic device where an unsolvable problem in a story is suddenly resolved by an unexpected, often supernatural, intervention. The term comes from ancient Greek theatre, where a god was physically lowered onto the stage by a crane (machina) to provide a solution or restore order. Today, it is often used to describe plot resolutions that feel abrupt or rely on forces outside the story’s established logic.