Dileepa in Hindu mythology is said to have been one of the most righteous and chivalrous emperors that the Solar Dynasty had ever produced. He was not blessed with a child for a long time and that caused great worry in his mind. In the matter of begetting a heir, he took the advice of Sage Vasishta. The sage divined his condition and told him that, once on the way back to earth after fighting a war on the side of the Gods, Dileepa failed to notice the divine cow Kamadhenu on his way and passed without paying his respects to her. Thereby he incurred the anger of the cow, who cursed the king to go childless. To negate the ill-effects of the curse, the King was advised to worship the divine cow Nandini who was the daughter of Kamadhenu, and thereby to earn her goodwill.

The king faithfully served Kamadhenu for twenty-one days. He slept where the cow slept, ate when the cow ate and washed the cow and took very good care of it. On the twenty-second day, when the cow was grazing in the field, a lion appeared suddenly and pounced to eat Nandini. The king tried to kill the lion but could not, because the lion happened to be a servant of Lord Shiva and he cast a spell on King Dileepa that made him motionless. The king wanted to protect the cow but could not do anything but speak. He begged the lion to spare the cow and eat him instead and bowed before the lion.

Seeing that the King was willing to sacrifice himself to save her, the cow was very much pleased. She revealed that the incident was actually a trick which she had played on the king to test his faithfullness. Nandini removed the curse of her mother and the King very soon begat a son, who came to be called as Raghu meaning one who was learned in the shastras and who vanquished the enemies in war.