The Puranas refer to Lord Ganesha as a valorous and great warrior. The warrior form of Ganesha is also known as Veera Ganapati. There are several legends in the religious scriptures that mention the instances related to the warrior form of Ganesha. These are discussed as follows-
Shiva Purana
According to the Shiva Purana, Lord Ganesha invested with great prowess from His birth. Goddess Parvati once found that there were no attendants to guard her abode. Hence she created a figure of a child out of turmeric paste that she used to wash herself. The goddess gave life into the image and Ganesha was born. She instructed the noble child to guard the entrance and prevent others from entering. He obediently followed her orders. Afterwards when Lord Shiva attempted to enter, he found that Lord Ganesha was preventing him from entering his own abode. Lord tried to convince the child, but all his attempts were in vain. Shiva then sent his celestial army (Ganas) to fight with Ganesha, but failed to defeat the child. When Parvati found out about the conflict, she blessed Lord Ganesha and asked him to perform his duty with sincerity. Thus Ganesha challenged the ganas and prevented them from entering.
Lord Shiva became infuriated and requested Lord Brahma to intervene in the affair. But Brahma was not even allowed to enter by Ganesha. Moreover Lord Ganesha pulled the beard of Lord Brahma and belaboured him. Brahma then declared that he was a Brahmin and asked for his forgiveness. Then Goddess Parvati intervened and settled the matter. Later Lord Shiva appeared and challenged Ganesha. The child fought valiantly against Shiva. But eventually the Lord decapitated Ganesha. Eventually at the suggestion of Lord Brahma, Shiva attached the head of and elephant to the body of Ganesha and brought him back to life.
Vamana Purana
Another legend is stated in the Vamana Purana which mentions that Lord Ganesha greatly contributed to the demolition of the Asuras or demons. When Lord Shiva went to subdue the demon Andhakasura, Lord Ganesha fought against a demon named Thunda who was one of the warriors of Andhakasura. After a fierce fight, Ganesha defeated and killed Thunda. Later the priest of the demons, Sukra, compelled Andhakasura to reanimate the dead asuras of the demon army. Lord Shiva assigned his son Ganesha to bring Sukra before him. Later while conducting the task, the elephant-headed Lord was surrounded and attacked by the demonic army. Ganesha fought single-handedly against the demons. Later Lord Brahma sent Lord Indra to Help Ganesha and they brought Sukra to Lord Shiva.
Brahmanda Purana
The Brahmanda Purana describes the legend of describes the fierce combat between Lord Ganesha and Parashurama. One day Lord Parashurama went to visit Lord Shiva in Mount Kailash. However he was prevented from entering the abode by Lord Ganesha who was formed as a guard of Goddess Parvati. This greatly angered Parashurama and he started to fight with Lord Ganesha. Then Lord Parashurama threw his axe at Ganesha. The elephant headed deity knew that the divine axe was granted by his father Lord Shiva. Hence he allowed the weapon axe to cut off one of his tusks.
Goddess Parvati became enraged after discovering that a tusk of her elder son was chopped off. Then Lord Shiva appeased Parvati and persuaded her not to harm Parashurama. Then Lord Parashurama bowed down to Shiva, Parvati and Ganesha and asked for forgiveness. Thus Ganesha was also known as Ekadanta which means The Lord with a Single Tusk.