Your character was about to die. Nay, he should have died, yet he didn't. A metaphysical force saved him. The writing world calls this action a deus ex machina.
Deus ex machina is a Latin  term meaning "god from the machine", as the action was often performed by an elaborate machine on stage in Greek dramas .
In the writing world of today, a deus ex machina does not have to be performed by a god, it can be simply a highly "convenient" happening, such as a previously unintroduced character showing up to save the day and dying on the next page. There are far more examples to be found.
Using a deus ex machina cheapens your prose. It is far from recommended. The alternative is, of course, a properly foreshadowed, or at least completely rational, ending.