It is said to be built by Khush, Lord Rama's son. Legend has it that he almost destroyed the water-living Nagas (semi-divine snake people) because he suspected them of stealing his amulet. Only Lord Shiva's intervention saved the semi-divine snakes. Khush then established this temple showing the Nagas worshipping Lord Shiva, his father's favourite deity. Another version of this legend states that the lost amulet was found by a Nag-kanya (young girl from the Naga tribe), who fell in love with him, and as she was Lord Shiva's devotee he constructed this temple for her.