Ganesha met Tripurasur in the guise of a Brahmin. Tripurasur was mesmerised by Ganesha’s precious stones. So Ganesha gave him the diamonds and the pearls. This made Tripurasur very happy and he told the Brahmin to ask for a wish. The Brahmin (Ganesha himself) asked for the Chintamani (a wish-fulfilling jewel possessed by Shiva). Tripurasur reached Mount Kailash and asked Shiva to give him the Chintamani. Shiva refused, and a violent battle ensued. Finally, Tripurasur won the war. Shiva asked Sage Narad how Tripurasur defeated him. “O Lord, it is because you forgot to worship Ganesha before starting the war,” Narad told him. Shiva rectified his mistake by chanting the ‘OM’ mantra and remembering Ganesha. On the sound of ‘OM’, a five-faced and ten-handed form of Ganesha made an appearance. This ‘Omkar’ Ganesha gave Shiva a special mantra. Using this mantra, Shiva killed Tripurasur with just one arrow. On the place where he had slain Tripurasur, Shiva made Maha Ganpati’s shrine.