In Greek drama from the time of Sophocles and Euripides (5th century BCE), and then in Roman drama, plays were often brought to an end by the quasi-magical appearance of a God above the stage space. Through divine wisdom and power, the god would explain all the mysteries of the plot and resolve any remaining discord. The appearance of the god was achieved by means of a “machina” (Greek: “mechane”) – the word “machina” being used to designate any mechanical contrivance for performing work, such as a crane, windlass or catapult, and hence, figuratively and by transference, meaning any artificial contrivance, device or trick. The Latin phrase “deus ex machina”, meaning “God from the …
Editors. "Deus ex machina". The Literary Encyclopedia. First published 28 June 2004; last revised 30 November -1.
[http://www.litencyc.com/php/stopics.php?rec=true&UID=1436, accessed 25 April 2015.]