In the "Gazetter of Mysore" , Benjamin Lewis Rice describes a legend behind the consecration of the temple. Kempe Gowda, while on a hunt, rode far away from his capital Yalahanka. Being tired, he rested under a tree and fell asleep. The local deity Someshwara appeared to him in a dream and instructed him to build a temple in his honor using buried treasure. In return the chieftain would receive divine favor. Kempe Gowda found the treasure and dutifully completed the temple. According to another version of the legend, King Jayappa Gowda from a minor dynasty of the Yelahanka Nada Prabhus was hunting in a forest near the present Halasuru area, when he felt tired and relaxed under a tree. In a dream, a man appeared before him and told him that a linga was buried under the spot where he was sleeping. He was instructed to retrieve it and build a temple. Jayappa found the treasure and initially built the temple out of wood. Another account attributes the temple to the Chola Dynasty with later renovations made by the Yelahanka Nada Prabhus.
Temple plan
According to Michell, the temple plan follows many of the basic elements of Vijayanagara architecture though at a lower scale. The temple has a square sanctum which is surrounded by a narrow passageway. The sanctum is connected to a closed mantapa whose walls are decorated with pilasters and sculptures in frieze. The closed mantapa is connected to a spacious open mantapaconsisting of four large projecting "bays". The piers leading to the sanctum and those facing outward from the open mantapa are the standard Yali pillars. The eastern gopuram is a well executed, typical 16th century structure. There are several notable sculptures and decorative features in the complex. An impressive pillar stands near the tall tower over the entrance gate. The tower itself exhibits well sculptured images of gods and goddesses from Hindu mythology. The open mantapa consists of forty eight pillars with carvings of divinities in frieze. To the north is the navagraha temple with twelve pillars, each pillar representing a saint. The entrance to the sanctum exhibits sculptures of two "door keepers". Other notable works of art include sculptures that depict King Ravana lifting Mount Kailash in a bid to appease the god Shiva, Durga slaying Mahishasura, images of the Nayanmar saints, depictions of the Girija Kalyana, the saptarishis. Recent excavations at the temple site has revealed the existence of a temple tank which could be 1200 years old.