Gajendra Moksha (Sanskrit: गजेन्द्रमोक्षः) or The Liberation of Gajendra is a Puranic legend from the 8th Skandha of the Bhāgavata Purāṇa, one of the most sacred books in Hinduism. It is one of the famous exploits of the god Vishnu. In this episode, Vishnu came down to earth to protect Gajendra, the elephant, from the clutches of Makara, the Crocodile, and with Vishnu's help, Gajendra achieved moksha, or salvation. Gajendra then attained a form like that of the god (Sarupya Mukti) and went to Vaikuntha with Vishnu.
This story was narrated by Sri Suka to Emperor Parikshit at Parikshit's request.
There was once an elephant named Gajendra who lived in a garden called Rtumat 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. On a hot day, he proceeded with his herd to a lake to cool off in its fresh waters. 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 his family, 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 (it is believed that the crocodile held Gajendra's foot for over a thousand years), and when he had spent his last drop of energy, Gajendra called to the god 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 a lotus with his trunk. Seeing this, Vishnu was pleased and with his Sudharshana Chakra, he decapitated the crocodile. Gajendra prostrated himself before the god. Vishnu informed Gajendra that he, in one of his previous births, had been the celebrated King Indradyumna, a devotee of Vishnu, but due to his disrespect to the great Sage Agastya, he had been cursed to be reborn as an elephant.