While Yudhisthira was walking towards the gates of heaven, a dog followed him. The other Pandavas, along with Draupadi, had died on the journey across the Himalayas, but the dog accompanied him throughout. Finally, Yudhisthira reached the gates of heaven. There, Indra appeared with a chariot and Yudhisthira mounted it. The dog was about to jump in too, but Indra got angry and declared that there was no place in heaven for a dog. Hearing this, Yudhisthira calmly got off the chariot and announced that he would not go to heaven unless the faithful dog was allowed to come along with him. Suddenly, the dog was transformed into Dharmaraja. He praised Yudhisthira for his wisdom and blessed him. Then Yudhisthira went to heaven.