According to the sacred scriptures, Lord Ganesha is believed to have countless incarnations, so numerous that their full description would take centuries. Among these, eight principal incarnations, known as the Brahmadharaka forms, hold special significance. One notable incarnation is Lord Vighnaraja, revered as the Vishnu-Brahma form. As detailed in the Mudgala Purana, He rides Sheshanaga and triumphantly defeated the demon Mamatasura. After Her marriage with Lord Shiva, Mata Parvati was engaged in cheerful banter with Her companions. From Her joyous laughter emerged a majestic figure, as grand and awe-inspiring as a towering mountain. This radiant being approached Goddess Parvati with deep reverence and declared - "O Mother! I have originated from your laughter as your son. Whatever command you bestow, I shall faithfully obey."

Mata Parvati said - "I was in a state of sulking with my beloved Lord Shiva; it was during this state that you were born. Therefore, your name shall be Mama (Mamata), as you are born of my sulking nature. Come and remember Lord Ganesha. Through His grace, you shall attain everything." Goddess Parvati then bestowed upon him Lord Ganesha's Shadakshari Mantra, "Vakratundaya Hum." Bowing to the Goddess, Mamatasura departed towards the forest. There, he encountered a demon named Shambharasura. Shambharasura asked Mamata - "Who are you, and for what purpose have you come to this forest?"
Shambharasura said to Mamata - "O Mahabhaga! I have come to impart knowledge to you. With this knowledge, you will become immensely powerful." Thus, Shambhara trained Mamata in various demonic arts. Through the practice of these skills, Mamata gained the Kamarupa. Grateful for the knowledge, Mamata said to Shambhara - "I am your disciple. Please command me, and I shall do as you say." Shambhara then advised Mamata - "Perform intense penance to please Lord Vighnaraja and seek from Him the dominion of the universe and the boon of immortality. Once you obtain these boons, be sure to return and meet me."
Following Shambhara's instructions, Mamatasura returned home and undertook intense penance for a thousand celestial years, surviving solely on air, to please Lord Vighnaraja. Pleased by his devotion, Lord Gajanana appeared and asked him to request a boon. Mamatasura sought the same boons that Shambhara had advised him to ask for, including an infallible weapon and invincibility. The compassionate and benevolent Lord Gajanana granted him these extraordinary boons. Mamatasura then shared the details of his penance and the boons with Shambhara. Shambhara introduced him to the Daityaguru Shukracharya, who declared Mamatasura as Daityaraja, the king of demons.
Daityaguru Shukracharya appointed five mighty chiefs named Preta, Kala, Kalapa, Kalajita, and Dharmaha for Mamatasura. Mamatasura was married to a maiden named Mohini, and they had two sons, Dharma and Adharma. The Rakshasas, Daityas, and Danavas were extremely pleased and satisfied with Mamatasura's rule. He lived happily in his worry-free city, Nirmamapuri. At one point, Mamatasura expressed his desire for universal conquest to his Guru, Shukracharya. The Guru advised him - "You may indeed conquer the Trilokas, but never oppose Lord Vighneshvara. It is because you have achieved everything only due to His grace."
Mamatasura, with his massive demon army, conquered both Earth and the Patala. Following this, he advanced towards heaven, where he engaged in a fierce battle with Lord Indra. However, due to the boon granted by Lord Vighnaraja Ganapati, even heaven fell under Mamatasura's control. Neither Lord Vishnu nor Lord Shiva could stand against him. Injustice and unrighteousness spread everywhere. Lord Vishnu, the consort of Goddess Lakshmi, advised all the Gods to collectively worship and praise Lord Vighnaraja. He suggested that only through such devotion could the reign of righteousness be restored. The Gods began their worship using the Ekakshari Mantra dedicated to Lord Vighnaraja. After a year of intense devotion, on the auspicious day of Bhadrapada Shukla Chaturthi, during the midday hour, Lord Vighnaraja appeared before the Gods. The Gods expressed their heartfelt suffering to Him and requested a boon to end the reign of sin and restore order. The compassionate Lord Ganapati granted their wish.
When Mamatasura heard this news, he was both astonished and extremely enraged. At that moment, Devarshi Narada arrived at his court and said - "I have been sent by Lord Vighnaraja. It is by His grace that you have become all-powerful. Due to your misdeeds, the Gods are suffering in captivity, and righteousness has been lost. Lord Vighnaraja is a supporter of Dharma and an enemy of wrongdoers. Therefore, cease these unrighteous acts and seek refuge in Lord Vighnaraja; otherwise, your destruction is inevitable." Even Shukracharya advised Mamatasura similarly, but Mamatasura refused to heed anyone's counsel.
Mamatasura, along with his two sons, set out for battle, shaking the Earth with his might. Angered by Mamatasura's wickedness, Lord Vighnaraja released His divine lotus into the midst of the demon army. The fragrance of the lotus rendered Mamatasura and his entire army powerless and unconscious. When Mamatasura regained consciousness, he fell at Lord Vighnaraja's feet and worshipped Him with utmost devotion. Pleased by his sincere worship, Lord Vighnaraja said -
"O Mamatasura! Reside fearlessly in your place while worshipping me. Partake in the superior fruits of actions performed without adherence to righteous methods. Where my worship has not been conducted before, enchant those places with your affection and establish yourself in their hearts to rule. Show love and protect those who are devoted to me with a Dasa Bhava i.e. servant-like attitude. For those whose hearts are devoid of my devotion, instil affection within them."
Obeying Lord Vighnaraja's command, Mamatasura released all the Gods and quietly returned to his city. With this, righteousness was restored across the entire universe, and the reign of Dharma was re-established.