The Mahabharata's Vana Parva narrates the story of Savitri, daughter of King Ashvapati, who chose Satyavan, a virtuous prince living in forest exile with his blind father, as her husband despite being warned by the sage Narada that Satyavan was fated to die exactly one year after their marriage. Undeterred, Savitri married him and, as the foretold day approached, undertook a strict fast and vigil, insisting on accompanying Satyavan into the forest on the day itself despite his family's concern.
When Satyavan collapsed and died in the forest, Yama, the god of death, appeared personally to claim his soul, an honor tradition holds Yama extended only to Satyavan given his exceptional virtue. Savitri, rather than accepting the loss, followed Yama on his journey with Satyavan's soul, engaging him in an extended conversation on dharma and duty so wise and compelling that Yama granted her a series of boons, carefully worded by Savitri to avoid explicitly requesting Satyavan's life directly, until Yama, recognizing he had been outmaneuvered by her wisdom, ultimately granted Satyavan's life back to her as a final, honest boon.
The story closes with the couple's return, Satyavan restored to full health with no memory of his own death, and the subsequent revelation that several other misfortunes affecting Savitri's and Satyavan's families had also been resolved through the other boons her careful wisdom had secured.