Saved by the bell
This term means saved at the last possible moment. It comes from the time when people were buried with a bell above ground to which a string was attached. The string ran into their coffin. In case someone happened to be buried alive, the person could ring the bell to alert others and be saved from the grave. this idiom is also used a lot during boxing matches in which one boxer is “saved by the round bell” so that the boxer has a short time to rest and recover.