On being asked by the Sages how Andhak–the demon was appointed as the lord of Ganas by Lord Shiva, Suta narrated the following tale to them.–The mighty demon, Andhak was Hiranyaksh’s son. By the virtue of his austere penance he had received a boon of immortality from Lord Brahma. In course of time he conquered all the three worlds. He started tormenting the deities and as a result of which they had to take refuge in the causes of Mandarachal mountain.
The deities went to Lord Shiva and narrated their woeful tale to him. They also requested him to kill Andhak so that they could live in peace. Lord Shiva went to the place where Andhak lived accompanied by all the deities. When Andhak saw them coming, he attacked menacingly with his various weapons. The deities became scared and started running helter-skelter. Lord Shiva then killed Andhak with his trident. He then lifted the corpse with the help of his trident and kept in that position for a very long period.
The divine sight of Lord Shiva had liberated Andhak from all his sins. Finding himself in a helpless position, Andhak eulogized Shiva and begged for forgiveness. At last, Lord Shiva became pleased and brought Andhak down after lowering his trident. He gave him the designation of a Ganapati and made him the lord of his ganas.