Once, King Kaushik, who was also called Vishvamitra, was touring his kingdom with his army. He reached the ashram of Sage Vashistha, who invited him for meals. Vishvamitra asked him, "Do you have enough food to fed my army?" Vashistha said, he had a cow called Nandini to prepare a big feast for Vishvamitra and his army. Surprised at its powers, Viswamitra said, "What will you do with the cow in this forest? This cow will be more useful to a king. Give me this cow as a gift. " When Vashistha did not agree to his demand, Viswamitra forcefully captured the cow.
Separated from the sage who was like a father to her, Nandini was so sad that she ran away from the king's palace . She went back to Sage Vashishtha. Vishvamitra then went to a forest to perform a long tapasya to get Nandini . After ten years of tapasya , Shiva was very pleased and gave him many weapons. Vishvamitra took all the weapons to fight Vashistha. But he could not defeat Vashistha because he absorbed all his weapons using one powerful weapon. Vishvamitra went back to the forest to perform more tapasya. He meditated for many years and became a brahmarishi. Now he had all the powers to get Nandini, but he had attained such mental peace that he no longer wanted the cow .