When the demon king Hiraṇyākṣa performed penance to please Shiva in order to beget a child, Shiva gifted the boy to him and named him Andhaka due to his blindness. After Hiraṇyākṣa's death by Vishnu, Andhaka became the new king, but was not regarded as an Asura since he was born of the Devas. Disowned by majority of his clan, he performed a severe penance to please Brahmā. Brahmā thus appeared to him and offered him a boon. Andhaka requested that Brahmā give and make divine vision and immortality. Brahmā granted Andhaka these wishes, but warned him that he could still be killed by Shiva. Andhaka went back to his kingdom and subdued all his opponents as well as the Devas.