The legend of Lord Gajanana is mentioned in Ganesha Purana, which is one of the Upapuranas exclusively devoted to Lord Ganesha. Gajanana is the twelfth and the final form of Lord Ganesha. In this form, the lord is eternally determined to defend the dignity and status of mankind. Gajanana was born as the son of Lord Shiva and Goddess Parvati in the Dwapara Yuga. Red is his complexion and he is attributed with four arms. In this incarnation, a mouse or shrew served him throughout as his vahana or mount. The Ganesha Purana mentions that Gajanana was born as the son of Goddess Parvati. The elephant-headed deity took this form in order to eliminate the demon Sindura who terrified the gods, devas, humans and other beings in the universe.
After Lord Gajanana was born, He told Lord Shiva that he was born to annihilate the demon Sindura and save the earth. He also declared that he will confer supreme knowledge to His devotee king Varenya. The king had earlier performed tapas for Lord Ganesha which pleased the deity. Lord Ganesha bestowed a boon to the king that He would be born as Varenya`s son. When Varenya`s wife Pushpika gave birth to a son, a demoness abducted the infant. Thus, Gajanana requested Shiva to carry Him to Pushpika. This generous behaviour of the deity pleased Lord Shiva immensely.
Shiva summoned his divine bull Nandi and told him that the son of king of Mahismati kingdom and his wife Pushpika has been taken by a demoness. The Lord instructed Nandi to take the divine son of Goddess Parvati and place him beside Pushpika. But the divine child should reach the queen before she gains consciousness or else her life would be in jeopardy. Nandi, the divine bull moved fast and carried child Gajanana to the kingdom of Mahismati. Nandi placed the divine child beside queen Pushpika and went back to Lord Shiva at Mount Kailash.
The next morning, when queen Pushpika looked at the elephant-faced child, she became shocked and terrified. She ran away in horror and started crying in sorrow. Her attendants quickly went to her aid after listening to her cries. But the attendants also became scared at the sight of the elephant-headed child and ran away in panic. Everybody became scared of the divine child and some of them became unconscious. Then king Varenya came to the spot and announced that such a hideous infant could not be born to a human and the infant should not be kept in their royal abode. Hence, he instructed his messengers to take the child to a dense forest and to leave it there.
The messengers of Varenya carried child Gajanana and promptly left the kingdom. They reached the dense forest and reached a lake that contained clean and spotless water. It was believed that only wild animals could reach that region in the forest. The messengers then softly placed the divine child on the bank of the lake. They quickly went back to their kingdom and informed King Varenya that they left the hideous child in the dense forest and the wild animals would hunt and eat it soon. The noble king Varenya painfully listened to the information and bowed his head.
The divine child Gajanana lied on the bank of the lake where a jackal found him. Right at that moment sage Parasara also appeared there and discovered the infant. The sage thought that Devendra had created an illusion to distract him from performing his tapas. Parasara had never intentionally committed any sin. He prayed to the Supreme Lord to protect him and slowly arrived near the child. The divine infant had four arms, the head of an elephant and a divine appearance with the lustre of the Sun.
The sage kept looking at Gajanana and then looked at his lotus like feet which had the symbols of the lotus, a goad and a flag. Sage Parasara became overwhelmed and said that the child was a form of the eternal Brahman. He was perplexed as to why the child wanted to cheat him. He realised that the Lord had been born on earth to remove all sins and to save the earth and to redeem all the noble men and sages. The sage became overjoyed and emotional. Then Parasara appraised his luck and touched the red lotus-feet of the child over his head. He then brought the divine child to his abode and gave the infant to his wife. She embraced Lord Gajanana with utmost love and care.
The divine child grew up in the hermitage of Kapila and later he was bestowed with the mouse which served as his vahana or vehicle. After He became an adult, Lord Gajanana fought a fierce battle against the great demon Sindura and eventually eliminated him. Thus he relieved all the gods, sages and men from the terror of the demon. Afterwards when king Varenya discovered the truth about Gajanana (Lord Ganesha), he asked for his forgiveness and praised and worshipped him.