Just as scientific research is confirming that, indeed, the canine/human friendship goes back many millennia, it’s a good time to look at what the ancients have to say about the subject. For example, take the Mahabharata, the Sanskrit masterwork thought to be the longest-ever epic poem. Not only is it 1.8 million words, it’s also one of the oldest, with origins in the 8th century BCE.

It has been likened, by many experts, to be a combination of the “Iliad” and the “Odyssey,” the Bible, King Arthur’s tales—it is also the only one that begins with a dog and ends with one, as noted below. The part of the poem that got our attention tells how loyalty to a dog opened a pathway to heaven for the epic’s hero, King Yudhishthira. Toward the saga’s end, the king renounces his throne and, with his wife and four brothers, sets off on a final pilgrimage across India to reach heaven in the Himalayas. Along the way, Svana, a stray dog, joins the group.

During the journey, the king’s brothers and his wife die. Finally, Yudhishthira, with the dog at his side, nears his destination. Heaven’s gatekeeper and king of the gods, Indra, arrives in a golden chariot and invites Yudhishthira to pass into heaven. But when Yudhishthira asks Indra if Svana may accompany him, Indra tells him that dogs are not allowed.

Yudhishthira then says, “Lord Indra, Svana has given his heart to me. I cannot leave him. Rather than reject him, I will reject heaven and remain here with my dog.” Indra replies, “Your words prove that you truly are worthy of a place in heaven. Come in, and your dog is welcome, too.” At that moment, the dog is transformed into Dharma, the god of righteousness and the father of Yudhishthira! The king had passed the test Indra put to him, confirming his worthiness and achieving his reward through his fidelity to his dog.

This Hindu lesson is remarkable for many reasons, but foremost because it speaks to the loyalty we owe to the most loyal of our companions.