the jaws of death, defeat, etc.

the jaws of ˈdeath, deˈfeat, etc.

(literary) used to describe an unpleasant situation that almost happens: The team snatched victory from the jaws of defeat.
See also: jaw, of