deus ex machina (noun) 

Literally, “god from the machine,” deus ex machina (day-us eks MAH-kee-nah) is an unexpected power or event that saves a seemingly hopeless situation, especially as a contrived device in a play or novel. As I used it today: “In Greek tragedy, the hero is sometimes saved by a deus ex machina – i.e., an intervention by the gods. For America, that came in the form of the Federal Reserve.”