Since time immemorial, Lord Kumaraswamy (Subrahmanya) had been residing at the foot of Kumara mountain, along with his elder brother, Vigneshwara (Ganapathy), where river Kumaradhara, originating from the peak of Kumara mountain, was flowing. He had been protecting His devotees in and around that place, which is now called Subrahmanya. Kumara mountain nestles in the vast Sahyadri range of mountains, stretching from Gokarna to Kanyakumari. Lord Ganapathy, once, expressed His desire to His brother Kumaraswamy, to move to the west and take birth in a place, where rivers Nethravati and Falguni were flowing, and joined together, before merging in the Arabian Sea, with a view to fulfilling the wishes of His devotees. Lord Ganapathy was awaiting the arrival of that auspicious moment.
More than 800 years ago, King Veerabahu, born in Sun clan, was ruling the Tulu kingdom. He was a brave Kshatriya king, besides being a scholar, and paid due attention to the welfare of his subjects, and was engaged in religious pursuits. Like rulers in those days, he was fond of hunting wild animals. One day, Veerabahu along with his family and attendants, went on a hunting expedition. He moved from forest to forest, hunting and killing wild animals that devastated the crops cultivated by farmers and, at last, came to a vast forest area near the Arabian Sea. A famous Shiva temple existed at a place called 'Kadali Kshetra' (now called Kadri), lying to the east of the above forest. It is believed that this place was 15 square miles in area. Three miles to the east of 'Kadali Kshetra' was the "Gupta (secret) Kadali Kshetra'.
To the south of Kadri, there was 'Gorakshak Kshetra' or 'Goraknath Kshetra', and to its south, on the bank of the river Nethravati, existed a holy place called 'Jalashivalaya'. To the north of Kadri, on the bank of river Falguni, there was a Vishnu temple called 'Vishnu Sthan'. On account of these holy temples, the area surrounding the Shiva temple was considered very sacred. The king Veerabahu, after destroying wild animals, at several places, came to 'Swarna Kadali Kshetra' (Kadri), along with his family, and worshipped Lord Manjunath, with intense devotion. He was surprised to see a thick forest to the west of temple wherein, he thought, existed a large number of wild animals. In the said forest, there were several hermitages (Ashrams) of holy rishis including that of Bharadhwaja. In the middle of that forest, the king witnessed a strange sight of a tiger and a cow standing close to each other, and thought that the tiger was about to attack the cow. Fearing this, in a hurry, the king shot an arrow from his quiver, at the tiger, in order to protect the cow. Unfortunately, the arrow hit the cow, instead of the tiger, killing it on the spot. Upset at this incident of killing the cow, resulting in 'gohatya', the king ran around aimlessly, crying aloud why such a sin had been committed by him, though unknowingly, till he encountered sage Bharadhwaja living in that forest.
When the king narrated the incident to him, with anguish, seeking remedy for his sin, Bharadhwaja consoled him thus:" O king! You are really noble and lucky. This place is sanctified by the presence of Lord Shiva, owing to which all animals live in this forest, in love and harmony, devoid of hatred for one another. This is due to the sheer grace of Shiva. Have you not noticed a tiger and a cow, the habitual enemies, standing side by side? This is the land created by Parashuram, and holy Kashi (Varanasi) lies to the north, at a great distance. By the will of Shiva, who is compassionate, you killed the cow by oversight, resulting in 'gohatya'. Worry not. I am going to suggest an appropriate remedy (solution) for the sin committed by you, by implementing which not only will you be absolved of the sin committed by you, but will also contribute to the well-being of thousands of devotees visiting this place, until the sun and moon hold sway upon this earth. No doubt, what you have committed is nothing but sin, but the sin committed, deliberately, does not go unpunished, while the one committed, unconsciously, is entitled to 'prayashchitta' (atonement). Sage Bharadhwaja continued further:" O king! I advise you to construct a temple dedicated to Lord Shiva at the spot where 'gohatya' was committed by you, and install a Shiva-ling there, by doing which you can ensure uninterrupted worship of Shiva, so long as the sun and moon exist. This will not only expiate your sin, but also will ensure the prosperity of coming generations. Now that the four-square mile area wherein your arrow has fallen, and caused the death of the cow has already acquired the name, 'Sharapattana' or 'Sharavu', people will soon inhabit this place. With the passage of time, there will be a king's palace, houses of people and shops of merchants, and this place will, one day, become the central part of a beautiful town." Rishi Bharadwaj added: " O king! The task of undertaking the construction of a Shiva temple is, by no means, an easy one. First, before you begin the construction of the temple, you have to construct a tank to the north of the temple. To its south, you install a stone idol of cow. By the power of my tapas (meditation), I will see that the water of the Nethravati river flowing near the 'Gorakashram' emerges from the 'gomukha' as 'theertha'. The Shiva-ling installed at the spot where the arrow has fallen, will be known as 'Sharabeshwara', and the tank will be called 'Sharabeshwara thatak' (Sharabeshwara tank). Once you have constructed the sanctum sanctorum, 'mukha- mantap' in front of it, 'paulis' and the front 'gopura', at an auspicious moment, I will install the Shiva-ling. But, look! In order to earn the grace of Shiva, you should feed one lakh Brahmins, compulsorily, though it might seem a formidable task. In future, the deity Sharabeshwara will be known as 'Kashi Vishwanath' (presiding deity of Kashi) Himself, Sharatheertha will be called 'Ganga-theertha' (holy water of Ganga), and Sharapura will become famous as 'Kashi Kshetra' (abode of Kashi Vishwanath). Later, one day, Gajanana (Lord Vigneshwara, or Ganapathy) will visit this place, and on the southern wall of the temple will manifest Himself. In view of His proximity to Sharabeshwara, this temple will be known as 'Sri Sharavu Mahaganapathy temple', in course of time." Hearing the words of Rishi Bharadwaj, Veerabahu became happy, and started constructing the Shiva temple.
As instructed by Bharadwaj, the king constructed the tank, first, followed by installation of the stone idol of cow, construction of 'gopura', 'pauli', 'mukha-mantap', sanctum-sanctorum for Shiva, inner courtyard and outer courtyard. Then, rishi Bharadwaj prayed to mother Nethravati, with intense devotion, and She emerged from the 'gomukha' of the stone idol of cow. In the temple situated to the south of the tank, Bharadwaj himself installed the Shiva-ling. This was followed by a feast for one lakh Brahmins, arranged by the king. This is the story of how Shiva temple came to be built at Sharavu. Undeniably, it is mesmerizing, and auspicious.
Veerabahu did not have a male heir, so he decided to stay at Sharapura for some time, along with his wife. He used to pray to Shiva daily, with great devotion. During this period, the chieftain of Gangawadi, (or Bangawadi, and now known as Bangadi), Chandrashekhar Jain, was harbouring hatred towards Vishnuvardhan, the Hoysala king. Though Chandrashekhar Jain was only a subordinate ruler of Vishnuvardhan, he hated the latter, as he (Vishnuvardhan) had deserted the Jain faith and converted himself to be a devotee of Lord Vishnu. Chandrashekhar Jain fought an unsuccessful battle with Vishnuvardhan, and was killed by him. His son, Veera Narasimha Bangaraja, deprived of means of livelihood, approached king Veerabahu and sought his refuge. At the instance of rishi Bharadwaj, Veerabahu was pleased to accept him as his adopted son, and donated all his wealth and properties to him, besides making him the legal heir to his Tulu kingdom. Later, Veerabahu and his wife took to 'vanaprastha' (living in the forest for the purpose of tapas / God-realisation), while his successor, Veera Narasimha Bangaraja, built a palace to the east of Sharavu Shiva (Sharabeshwara) temple and lived in it.
During the reign of Veera Narasimha Bangaraja, Lord Ganapathy, with an intent to manifest Himself, on the southern wall of Sharabeshwara temple, was praying to His Mother Auspicious (Mangala Devi), thus:" O Mother! I appeal, fervently, to You, to grant 'darshan' (appearance) to king Veera Narasimha Bangaraja in his dream, and instruct him to construct a temple for You to the west of 'Goraknath Ashram', for the welfare of mankind. May the king worship Your idol, and the place where the temple will be located, known as Mangalapur (now called Mangalore). I would like to take birth at an auspicious moment, along with 'Siddhilakshmi' (Goddess of prosperity), on the southern wall of Sharabeshwara temple, so that I could keep gazing at You, always, Who are located at a little distance from me, in the southern direction.
My only desire is to grant prosperity to My devotees, over here." Acceding to the request of Lord Ganapathy, Mangala Devi appeared in a dream to king Bangaraja, and told him to look for a stone idol to the west of 'Goraknath Ashram'. She instructed the king to construct a temple at the spot where the idol will be found, and name it as "Mangala Devi'. She also ordered the king to name the area between Sharavu and Mangala Devi temple as "Mangalapur', and assured the king that She would grant prosperity to anyone praying to Her, with unflinching faith and devotion. King Bangaraja was ecstatic, when Mangala Devi appeared to him in his dream, with Her eight hands, and vanished. Though a follower of Jain faith, he rejoiced at the opportunity given to him of constructing a temple for Mangala Devi, in addition to the opportunity got by him earlier, to look after the affairs of Sri Sharabeshwara temple and Tulu kingdom. In fact, he thought that he had been twice blessed to get such an opportunity to construct Mangala Devi temple. Veera Narasimha Bangaraja, along with his ministers and subjects, visited the spot indicated by Mangala Devi, and found an idol in which Mangala Devi had enshrined Herself. He constructed a temple in that place, and installed the Mangala Devi idol, by following the prescribed rituals, with the help of holy rishis. The king also employed priests for conducting regular 'pujas' (worship) in the two temples (viz., Sharabeshwara and Mangala Devi temples). Soon, people engaged in different vocations, and from different places, came to reside in the town, and trade and commercial activities started. Many shopping centres also sprang up, and the town extended up to the seashore. King Bangaraja's palace lay in the centre of Mangalapur town. As per available records, king Veera Narasimha Bangaraja ruled the Tulu kingdom from 1157 A.D. to 1208 A.D.
After the death of Veera Narasimha Bangaraja, his son, Chandrashekhar Bangaraja, ruled the Tulu kingdom, happily, from 1208 A.D. to 1224 A.D., in the palace close to the Sharavu temple. During the reign of Chandrashekhar Bangaraja, there lived a Brahmin by name, Keshava, in Badaje village, near Manjeshwar, who was a scholar, 'mantravadi', and man of wisdom, and who belonged to Padakannaya clan, and did not have enough means to eke out his livelihood. He was deeply immersed in tapas of Lord Vigneshwara (Ganapathy) at the Jalashivalaya temple on the bank of Nethravathi river at Vasapur (now called Hoige Bazaar). His only aim was to achieve prosperity for his family, by undertaking 'mantravada' and tantric rituals, and invoking the blessings of Lord Ganapathy. Lord Ganapathy was moved by the tapas undertaken by the priest, and informed him that the time was now ripe for Him to manifest, and that He would grant prosperity not only to him and to his family, but also to his future generations. So famous was Keshava in his devotion to Lord Ganapathy that when he conducted 'Ganahoma' to the Lord everyday, He used to partake of the 'purnahuti' of 'Ganahoma' by showing off His real trunk (Ganapathy is the elephant-headed God, having a trunk).
One day, when Bangaraja was seated on the balcony of his palace, he saw a fleet of seven Chinese ships sailing along the coast of Mangalapur town, laden with golden ores and valuable jewels, to a far-off land. The king thought that if these ships were made to touch the port of Mangalapur town, he could confiscate the goods and become rich, overnight. However, this, he felt, was not an easy task, and was worried about how he could achieve it. When he was pondering over this, his subjects proposed to him to utilize the services of priest Keshava. Thereupon, the king called for the priest to his palace, and discussed the matter with him. The priest told the king that he could, by using the power of his mantras, make the ships sailing along the coast (without touching the town) land at the port of Mangalapur. The king was happy to hear the priest's words, and requested him to fulfill his wish. Soon, the priest started reciting the mantras, invoking the blessings of Lord Ganapathy who, in turn, ordered 'Vayudeva' (God of wind) to cause a storm in the sea. Suddenly, a violent storm took place in the sea, and all the ships were tossed ashore, to the surprise of everyone, without causing any damage either to the ships, or the crew. The king was overjoyed when the ships landed ashore, and he confiscated all the valuables in them, letting the crew unharmed, to proceed on their voyage. His wish having been fulfilled by the priest, the king asked of the priest what he expected from him, in return. The priest requested the king to provide him enough materials to conduct a 'Ganahoma' to the Lord, using 128 coconuts. The king, gladly, granted him the required materials. The priest went to his village, Badaje, and performed 'Ganahoma' to the Lord to please Him. To his astonishment, Lord Ganapathy refused to accept the 'purnahuti' offered by the priest, this time, by stretching His trunk. Upset at this happening, the priest rushed to Vasapur to undertake tapas and please the Lord. The Lord immensely pleased with the tapas, gave 'darshan' to the priest and told him that it was wrong on his part to measure His grace in terms of 'Ganahoma', using 128 coconuts, and that the Divine grace could not be measured in terms of worldly things. That is why He had refused to accept the 'purnahuti' offered by him earlier. Lord Ganapathy also told the priest that He would take birth along with 'Siddhilakshmi' on the southern wall of Sharabeshwara temple, shortly, and that he should worship (conduct 'puja' to Him) Him daily. So saying, Lord Ganapathy disappeared from the scene.
If one goes through the "Ganesh Purana' (mythological story of Ganapathy or Ganesh), in 'Krita Yuga', Lord Ganapathy was seen with ten hands, and had lion as His vehicle. In 'Treta Yuga', He had six hands, with peacock as His vehicle, and was married to 'Siddhi' and 'Riddhi', mental offsprings of Lord Brahma. In 'Dwapara Yuga', it seems Lord Ganapathy had four hands, with mouse as His vehicle. It looks strange that Lord Ganapathy decided to manifest Himself along with 'Siddhilakshmi' on His left side, in the present 'Kali Yuga'. According to 'puranas', it is possible that He may assume different forms in 'Kali Yuga', and subsequent Ages. It is believed that Lord Ganapathy at Sharavu (with 'Siddhilakshmi' seated on His left side) had manifested Himself in order to grant the wishes of His devotees People in 'Kali Yuga', generally, are not interested in 'tapassiddhi' or 'moksha', but only in material things. That Lord Ganapathy had chosen to appear along with 'Siddhilakshmi', assuming His beautiful form, on the southern side of Sharavu Shiva temple, does only indicate that He did so only to remove the obstacles of His devotees and make them successful in life, and also bestow wealth and prosperity on them.
Keshava, the priest, told king Bangaraja about the 'darshan' of Lord Ganapathy in His dream and His instructions to him to take over the responsibility of conducting 'puja' at Sharavu Shiva temple, from the king. The priest was eagerly looking forward to the impending manifestation of Lord Ganapathy on the southern wall of Sharavu Sharabeshwara temple. As expected, one fine morning, on an auspicious day, Lord Ganapathy, with ten hands, with 'Siddhilakshmi' on His left side, appeared on the southern wall of Sharavu Shiva temple, situated in the Bharadwaj Ashram, in order to ensure the welfare of the world. Priest Keshava was lucky to witness the manifestation of the Compassionate Lord with his own eyes, with a sense of awe. Moved by the wonderful sight, the priest rushed to the king himself, and brought him to the temple to show him the Divine form of Lord Ganapathy. The news of Lord Ganapathy's manifestation spread around like wild fire, and people in thousands, thronged the temple, to witness the miracle. Everyone was mesmerized, and blessed by the Lord to witness the strange event. From that day onwards, this place became famous as 'Sharavu Mahaganapathy Kshetra', and this place, along with Tulu kingdom and Mangalapur town, went on prospering, day by day, by the grace of two deities, viz., Lord Ganapathy and Goddess Mangala Devi. On the day of manifestation, Lord Ganapathy also appeared in the dream of Bangaraja, and instructed him to build a sanctum sanctorum, 'mantap', 'gopura', etc., and have the 'puja' conducted by the priest Keshava of Badaje village, which the king faithfully implemented. Priest Keshava was given a piece of land to construct a house close to the temple, by the king, and he began living in this house. Bangaraja also undertook renovation of Sri Mangala Devi temple, and built a fort in front of the estuary of the sea. That Lord Ganapathy Who had manifested on the southern wall of Sharavu Shiva temple, and is, still, being seen in His full glory by the devotees visiting the temple, and that He showering His blessings on them for their prosperity is, indeed, due to the meritorious deeds committed by them in the past.
In course of time, Tulu kingdom came to be ruled by several Bangarajas, in succession. They were Pandyastha Bangaraja (1224-39 A.D.), Vithala Devi (1239-1264 A.D.), Kamaraya I (1264-1274 A.D.), Padumala Devi (1274-1287 A.D.), Havali Bangaraja I (1287-1323 A.D.), Shankara Devi (1324-1349 A.D.), Havali Bangaraja II (1349-1400 A.D.), Lakshmappa Bangaraja I (1400-1455 A.D.), during whose period four palaces were built at Bangawadi (now called Bangadi), Belthangady, Mangalore and Nandavar, Shankara Devi II (1455-1491 A.D.), Kamaraya II (1491-1533 A.D.), Havali Bangaraja III (1533-1545 A.D.), Lakshmapparasa Bangaraja II (1545-1556 A.D.), Kamaraya III (1556-1612 A.D.), Lakshmapparasa Bangaraja III (1612-1629 A.D.), Havali Bangaraja Odeya IV (1629-1631 A.D.), Shankara Devi III (1631-1653 A.D.), Havali Bangaraja V (1653-1699 A.D.), Lakshmapparasa Bangaraja IV (1699-1767 A.D.) and Kamapparasa Bangaraja IV (1767-1799 A.D.). During the corresponding period of the above rulers, priest Ganesha Bhatta's descendants used to conduct the worship of Ganapathy at Sharavu Mahaganapathy temple, and undertake periodic renovation works by investing their own funds. Thus, the regular worship at, and administration of the temple by the descendants of Ganesh Bhatta continued for generation after generation, and the temple witnessed all-round progress.
In 1784 A.D., Tippu Sultan, well known as 'Tiger of Mysore', invaded Mangalore (Mangalapur), with his soldiers with a view to looting merchants and the rich people of the town. He knew that Mangalore was a prosperous town and that the then Bangaraja (king) was a weak ruler, and he could easily overthrow him from his kingdom. As darkness had enveloped the town when he reached Mangalore, along with his soldiers, he thought it fit to camp at the vast open ground in front of the Mahaganapathy temple, for the night. At the time of Tippu Sultan's invasion of Mangalore, Sharavu Krishna Bhatta was the priest and administrator of Mahaganapathy temple. On hearing the news of Tippu's invasion, the citizens of Mangalore were scared, and rushed to the priest, seeking his help. The priest requested them to stay calm, and told them that only Lord Mahaganapathy alone could help them in times of distress. He appealed to them to offer a mass prayer to Sharavu Mahaganapathy, seeking His protection from the impending peril, which they undertook. In the meantime, Tippu had finished his dinner, and thought of going to sleep, but he could not. He was haunted by a nightmare in which an elephant trampled on him, lifted him with its trunk, and threw him to the ground. This haunted him continuously and disturbed his sleep. He called for his minister Purnayya and sought his advice. Then Purnayya walked towards Mahaganapathy temple, and consulted the priest Ganesha Bhatta, who told him that Tippu's nightmare was caused because of the anger of Lord Mahaganapathy, Who did not approve of Tippu's evil intentions. When Purnayya apprised Tippu of this, he immediately called for the priest, who, in turn, went to meet him. He told the priest that he feared the supernatural powers of Lord Mahaganapathy and that, from then onwards, he would become a devotee of Him and would construct a temple for Him at Srirangapatna, near his palace, and worship Him. Tippu also told the priest that he would grant a 'tasdiku' of four 'varaha' (equivalent to sixteen rupees) a day from his government. Next morning, Tippu abandoned his plan of looting Mangalore town and, after partaking of the hospitality of Bangaraja, returned to Mysore, along with his troupe. That Lord Mahaganapathy with His supernatural powers, made even a follower of another faith, believe in Him is, strangely, surprising!
During the period when Badaje Keshava was the priest of Sharavu Mahaganapathy temple, there lived one Ganesh Kekunnaya in Padmunnur village, near Nandavar, along with his wife and children. He was awfully poor, and was an ardent worshipper of Lord Ganapathy. He was engaged in tapas of Lord Ganapathy with a view to getting rid of his extreme poverty. One day, Lord Ganapathy appeared in Ganesh Kekunnaya's dream and instructed him to go to Sharavu Mahaganapathy temple and take charge of the right of Lord Ganapathy's worship from Badaje Keshava, the next day. The Lord also appeared in the dream of Badaje Keshava, at the same time, and instructed him to hand over the right of worship, along with his house and other possessions, to Ganesh Kekunnaya. Accordingly, Ganesh Kekunnaya took charge of the right of worship of the temple from Badaje Keshava, and came to be called Ganesh Bhatta, thereafter. While handing over charge of the temple, Badaje Keshava told Ganesh Kekunnaya that he (Ganesh Kekunnaya) and his descendants, alone, had the right to worship the Mahaganapathy and, no one else, without their consent, could worship the deity. In case, the right of worship was granted to any other person, their progeny would be wiped out.
As per court documents, Sharavu Krishna Bhatta died in 1820 A.D. He had two sons, viz., Narna Bhatta and Ganapathy Bhatta. Ganapathy Bhatta had a wife by name Venkamma, and did not have any children. He was a great scholar in Sanskrit and well-versed in scriptures. He had written several manuscripts in Tulu script on palm-leaves, which are now in the possession of Sharavu Ramakrishna Shastry's family. As Sharavu Ganapathy Bhatta was a great scholar, once he was called to the court of Mummadi Srikrishnaraya, king of Mysore, for seeking his considered opinion on a ticklish issue. During that period, there was a hot debate going on between Shaivites and Vaishnavites (followers of Lord Shiva and Lord Vishnu respectively) as to who was superior between them. Sharavu Ganapathy Bhatta went to the king's court, as requested by the king, and addressing the scholars assembled there, put forth his views thus: " Though there is only one God, we worship Him in different names and forms. It is only to fulfil our different desires. However, since time immemorial, it has been the tradition to pay obeisance to Lord Ganapathy flanked by Siddhilakshmi, at the outset, before invoking the blessings of any other gods for fulfilling our desires. This holds true even in the case of conducting any ' yajna', or any other ritual worship of gods. That is why even Tippu Sultan, though a follower of Muslim faith, became a devotee of Lord Mahaganapathy. Hence, it is not right on our part to discriminate one god from another. We should consider all gods as One and, before worshipping any god, should, invariably, pay obeisance to Lord Ganapathy." The above explanation offered by Ganapathy Bhatta convinced the scholars present in the court, about the futility of the ongoing debate among them as to which god is superior to which. The Maharaja (king) of Mysore was very much pleased with the explanation of Ganapathy Bhatta, and he honoured him with the title 'Shastry' and presented him with a gold ring, bearing the emblem of Maharaja, a shawl and 80 gold coins. From then onwards, Ganapathy Bhatta came to be known as 'Ganapathy Shastry', and this title is, still, being suffixed to the names of his descendants, even now. Ganapathy Shastry died in 1836 A.D.