Brief description of the Hindu legend is as follows.
Gajendra was an elephant king. One day he went to a lake and stepped into it. A crocodile caught hold of his leg and would not leave it inspite off strenuous efforts by the elephant to free himself. At last in vain, Gajendra called out fervently to the god Vishnu to save him. The Lord heard Gajendra’s prayers and saved him from the crocodile.