There must be dozens of stories of this. A few years ago Oprah had as a guest a young woman who, trapped in a car which had gone off a bridge, hidden from view and possible rescue, self-amputated a leg to escape. About 5 years ago a young man hiking in the Grand Canyon became trapped when a rock tumbled and pinned his hand. He cut off the hand to escape.
It really makes one wonder what pain is, exactly.
In this story from yesterday (twittered by Mo of Neurophilosophy), a young man's leg was pinned by a concrete girder. He managed to cut most of it off himself, but a friend nearby had to help break the bone.
His brain decided the threat to his ongoing existence was greater than any threat from any upcoming nociception. It was capable of downregulating its own sensory input enough to allow him to remain conscious and focused and on task, as it realized this was its organism's only shot at surviving. In this way the seemingly impossible becomes possible, without loss of consciousness, and in spite of what must be a large loss of blood.