Gajendra Moksha
Gajendra Mokṣaḥ () or The Liberation of Gajendra is a Puranic legend from the 8th Skandha of the Bhāgavata Purāṇa, a sacred text in Hinduism. It is one of the famous exploits of the preserver deity, Vishnu. In this episode, Vishnu came down to earth to protect Gajendra, the elephant, from the clutches of a crocodile, alternatively known as Makara or Huhu, and with Vishnu's help, Gajendra achieved mokṣa, or liberation from the cycle of birth and death. Gajendra then attained a form like that of the deity (Sarupya Mukti) and went to Vaikuntha with Vishnu. This story was narrated by Shuka to King Parikshit at Parikshit's request. Legend 

There was once an elephant named Gajendra who lived in a garden called Ṛtumat, which was created by Varuna. This garden was located on Mount Trikuta, the "Three-Peaked Mountain". Gajendra ruled over all the other elephants in the herd. One day, as usual, he went to the lake near by to pick lotus flowers to offer prayer to Vishnu. Suddenly, a crocodile living in the lake attacked Gajendra, and caught him by the leg. Gajendra tried for a long time to escape from the crocodile's clutches. All of his herd, relatives, and friends gathered around to help him, but in vain. The crocodile simply would not let go. When they realised that ‘death’ had come close to Gajendra, they left him alone. He trumpeted in pain and helplessness until he was hoarse. As the struggle was seemingly endless, when he had spent his last drop of energy, Gajendra called to his deity Vishnu to save him, holding a lotus up in the air as an offering. Hearing his devotee's call and prayer, Vishnu rushed to the scene. As Gajendra sighted the god coming, he lifted the lotus with his trunk. Seeing this, Vishnu was pleased, and with his Sudharshana Chakra, he decapitated the crocodile. Gajendra prostrated himself before the deity. Vishnu informed Gajendra that he, in one of his previous births, had been the celebrated King Indradyumna, a Pandyan King (modern day Tamil nadu) a devotee of Vishnu, but due to his disrespect to the great sage Agastya, he had been cursed to be reborn as an elephant. Because Indradyumna had been devoted to Vishnu, the deity had him born as Gajendra and made him understand the concept of Kaivalya, which was beyond Svarga and Urdhva Loka, the realm of the gods. Indradyumna was to attain moksha when he (as Gajendra) left all his pride and doubt, and totally surrendered himself to Vishnu. The prayer made by Gajendra on this occasion became a famous hymn in praise of Vishnu called the Gajendra Stuti. This hymn was later inducted as the first and foremost hymn of the Vishnu Sahasranama (The work that is composed of the 1,000 names of Vishnu). शुक्लांबरधरं विष्णुं शशि वर्णं चतुर्भुजं ।
प्रसन्न वदनं ध्यायेत् सर्व विघ्नोपशान्तये॥

śuklāṃbaradharaṃ viṣṇuṃ śaśi varṇaṃ caturbhujaṃ |
prasanna vadanaṃ dhyāyēt sarva vighnōpaśāntayē ||

Previous births

Gajendra, in his previous life, was Indradyumna, a great king who was devoted to Vishnu. One day, Agastya, a great rishi (sage) came to visit the king, but Indradyumna remained seated, refusing to rise up to receive the sage with due respect. Agastya was irate and noticed that the mighty king, despite the greatness of his good deeds, still had traces of ahamkara, or egoism, and he revealed to the king that, in his next birth, he would be born as an elephant, and in that form he would learn the hard way that the self must be renounced and surrendered to God. The crocodile, in its previous birth, had been a Gandharva king called Huhu. The sage Devala came to visit the king, and when the two of them were bathing and Devala was offering prayers to Surya (the Sun god), the king pulled the sage's leg for fun. The sage was furious and cursed the king to become a crocodile in his next life. The repentant king begged the sage's pardon. Devala explained that he could not reverse the curse; however, he informed Huhu that Vishnu would slay him as the crocodile and liberate him from the cycle of birth and death. Symbolism

The tale of Gajendra is an integral theme in Vaishnavism and has great symbolic value: Gajendra is the man, the crocodile is sin, and the muddy water of the lake is Saṃsāra. The symbolic meaning of Gajendra moksha is that materialistic desires, ignorance, and sins create an endless chain of karma in this world and are similar to a crocodile preying upon a helpless elephant stuck in a muddy pond. Humans are thus stuck in a continuous cycle of death and rebirth until the day when they can look beyond everything in this creation and ultimately submit themselves to the supreme being, Vishnu. 