There ruled a king named Kshoopa whose friend was Sage Dadhichi. Once they got into argument over the superiority of their respective castes. King Kshoopa was of the opinion that a Kshetriya was superior to Brahmin. Very soon, the dispute took an ugly turn and a duel broke out between them.
Dadhich punched Kshoopa on his head. Kshoopa retaliated by attacking Dadhichi with his weapon named Vajra. The assault proved to be fatal for Dadhichi and he fell down. Before his death he prayed to his guru-Shukracharya and sought his help. Realizing that his disciple was in danger, Shukracharya rushed to the spot, but Dadhichi had already died before he could arrive there.
Shukracharya knew the secret learning, Mritasanjivani Vidya. He brought back Dadhichi alive and advised him to please Lord Shiva to attain invincibility. He also taught Dadhichi the proper methods of worshipping Shiva. Dadhichi did an austere penance and pleased Lord Shiva. Lord Shiva appeared and blessed him with invincibility and also made his bones as hard as Indra’s thunderbolt (Vajra).
Dadhichi then went to fight Kshoopa. He kicked Kshoopa on his chest. Kshoopa retaliated by attacking Dadhichi with his Vajra. But this time Dadhichi remained unharmed. Kshoopa was surprised to see his assault going in vain. He decided to take the help of Lord Vishnu and engaged himself in austere penance.