There was a king on the Gandharva planet whose name was Hūhū. Once this King Hūhū was enjoying with women in the water, and while enjoying he pulled the leg of Devala Ṛṣi, who was also taking a bath in the water. Upon this, the sage became very angry and immediately cursed him to become a crocodile. King Hūhū was very sorry when cursed in that way, and he begged pardon from the sage, who in compassion gave him the benediction that he would be freed when Gajendra was delivered by the Personality of Godhead. Thus the crocodile was delivered when killed by Nārāyaṇa.
When Gajendra, by the mercy of the Lord, became one of the Lord's associates in Vaikuṇṭha, he got four hands. This achievement is called sārūpya-mukti, or the liberation of receiving a spiritual body exactly like that of Nārāyaṇa. Gajendra, in his previous birth, had been a great devotee of Lord Viṣṇu. His name was Indradyumna, and he was the King of the Tāmila country. Following the Vedic principles, this King retired from family life and constructed a small cottage in the Malayācala Hills, where he always worshiped the Supreme Personality of Godhead in silence. Agastya Ṛṣi, along with many disciples, once approached King Indradyumna's āśrama, but because the King was meditating on the Supreme Personality of Godhead, he could not receive Agastya Ṛṣi properly. Thus the ṛṣi became very angry and cursed the King to become a dull elephant. In accordance with this curse, the King was born as an elephant, and he forgot all about his previous activities in devotional service. Nonetheless, in his birth as an elephant, when he was dangerously attacked by the crocodile, he remembered his past life in devotional service and remembered a prayer he had learned in that life. Because of this prayer, he again received the mercy of the Lord. Thus he was immediately delivered, and he became one of the Lord's four-handed associates.