We have heard the stale of the Rakshas King Mahishasur and how he was killed by Goddess Durga in a fierce battle that went on for nine nights. Mahishasur had a son whose name was Gajasur. Mahishasur was a Rakshas in the form of a buffalo or a Mahishi. while Gajasur was a Rakshas in the form of an elephant.
When Mahishasur was killed, Gajasur was seething with rage. He wanted to avenge his father's death. Therefore, he medan to pray to Lord Brahma, and his penance or Tapasya was very severe. Bramha ji appeared in front of Gajasur, and he was pleased with the prayers. He asked the Rakshas what he wanted.
Gajasur asked for a boon that would make it nearly impossible to kill him. He had asked that no God, not even Lord Vishnu, could kill him. His wish was granted.
Gajasur became a ruthless and power drunk Rakshas after this. He conquered and captured the three worlds - Swarg, Pruthvi and Patal Lok. He declared that no Gods or deities should be prayed in his regime. People began to worship him as the true god instead. He began to harass and torture Rishis, sages and other religious persons. His boon, given by Lord Brahma, had made him arrogant and he felt that he was invincible.
One day, Gajasur arrived in the city of Kashi. They say, Lord Shiv resides in this city. Oher than Mount Kailas in the Himalayas, he prefers to spend time here. Gajasur and his troops ravaged the holy city. They plundered it, killed many innocent people, and unleashed a reign of terror.The sadhus, priests and ordinary folk prayed to Shiv and pleaded to protect them.