Lord Shiva had committed a grave sin of Brahmahatya. All his efforts of separating Brahma’s skull from his left palm went in vain. In the meantime, an entity named Brahmahatya appeared before him and entered into his body.
Lord Shankar decided to go to Badrikashrama to atone for his sins. After reaching there, he became worried when he did not find Lord Vishnu. He went to take a bath in river Yamuna but as soon as he entered the river, the water dried up. He experienced this strange phenomenon at the Saraswati River as well. He then made pilgrimages to numerous sacred and holy places but still did not become free from Brahmahatya. Dejected, he ultimately went to Kurukshetra where he found Sri Narayana and requested him to free him (Shankar) from the sins of Brahmahatya. Lord Vishnu advised him to go on a pilgrimage to Varanasi where he would be liberated from his sins.
Following Vishnu’s instructions, Lord Shankar went to Varanasi and visited all the sacred sites like Dashashwamedh temple, Lolarka temple and Keshav temple. While he was worshipping Keshav, he said- “Though I have become liberated from my sins, yet I fail to understand the reason why this skull still sticks in my hand.” Keshav told him that his problems would be solved if he takes a bath in the lake, which was near the temple. Lord Shankar took a bath in that lake and ultimately the skull fell on the ground. The place where the skull had fallen later on became famous as Kapalmochan.