This extraordinary story is that of Devavratha, who became known as Bhishma after he took the bhishama pratigya ('terrible oath') — the vow of lifelong celibacy and of service to whomever sat on the throne of his father (the throne of Hastinapur).
He took this oath so that his father, Shantanu could marry a fisherwoman Satyavati — Satyavati's father had refused to give his daughter's hand to Shantanu on the grounds that his daughter's children would never be rulers. This made Shantanu despondent, and upon discovering the reason for his father's despondency,
Devavratha sought out the girl's father and promised him that he would never stake a claim to the throne, implying that the child born to Shantanu and Satyavati would become the ruler after Shantanu. At this, Satyavati's father retorted that even if Devavratha gave up his claim to the throne, his (Devavratha's) children would still claim the throne. Devavratha then took the vow of lifelong celibacy, thus sacrificing his 'crown-prince' title and denying himself the pleasures of conjugal love.
This gave him immediate recognition among the gods. His father granted him the boon of Ichcha Mrityu (control over his own death — he could choose the time of his death, making him immortal till his chosen time of death, instead of completely immortal which would have been an even more severe curse and cause of suffering).