According to the legend, Srikalahasti Temple is named after Sri (spider) Kala (serpent) hasti (elephant) after the three ardent devotees of Lord Shiva. These three animals attained divinity by worshipping Lord Shiva. The spider was Lord Vishwakarma`s (architect of the deva ganas) son Oornanabha. He was trying to replicate Lord Brahma`s creation and thus annoyed Lord Brahma who cursed him to become a spider. Shiva himself cursed the snake. The elephant was god Pramadha cursed by Shiva`s wife, Parvati, when he intruded on their privacy. The Shiva linga here is an amalgamation of the three animals.
The spider as devotion wanted to spin webs in the shape of temples and mandapams. The morning dewdrops would make the cobwebs look like pearl houses and sunrays would make them shine like rubies. But these would break and crumble with the wind. The spider would connect the threads and weave the web all over again. One day Shiva, to test the spider`s devotion, burned his webs with a lamp from his shrine. The enraged spider swallowed the flame and sacrificed its life. Pleased with his devotion, as a boon, Shiva merged the spider unto himself, so one can still see the spider on the Linga.
The serpent worshipped the linga with precious gems. An elephant, would bathe in the nearby Swarnamukhi River, push the precious gems away and worship the linga with leaves and flowers from the forest. The next day the snake, finding her precious offerings pushed away, would get enraged. The serpent pushed away the leaves and flowers and worshipped the linga with the precious gems it brought from underground. One day the snake got upset and kept a watch hiding under the leaves waiting to catch the mischief-maker. The elephant also lost its temper finding her offerings pushed away everyday. So on a particular day it came early and was pleased to find the flowers undisturbed. It went and took bath and brought fresh flowers and leaves. While the elephant was clearing the previous day`s leaves and flowers, the snake got into the elephant`s head through its trunk, causing unbearable pain. The elephant ran helter-skelter with pain and banged its head on a mountain. He died; the snake was also crushed to death. Lord Shiva took them into his fold. The main linga is shaped like an elephant trunk, with tusks on each side and a figure of the spider at the bottom. The linga it looks like a snake with five hoods from above.
The spider is called "Sri," the snake "Kala," and the elephant "Hasti." The three are combined together in the name Srikalahasti. The spider is said to have a web above the linga to protect it from the sun and rain. The elephant would get water with its trunk and bath the linga (perform abhishek) and the snake would perform worship.