Several legends tie together the five Pancharama temples dedicated to Shiva.  

History Of PANCHARAMA Temples

               Groups of temples constitute pilgrimage clusters all over India. Thus we have thePancha Bhoota shrines dedicated to lordEeswar,the twelve Jyotirlinga shrines all over India, the Alwar Nava Tirupati shrines of Tirunelveli district in Tamilnadu, Arupadai Veedushrines  and so on. Temples in each group are linked through a common thread of legends and beliefs. The Pancharama temples in Andhra Pradhesh constitute an example of one of these groups of   pilgrimage centers. Several puranic legends are associated with these five shrines and the foremost of it has to do with the destruction of the demon Tarakasura by Skanda. Legend has it that when Subramanya killed the demon Tarakasura, the Shivalingam in his throat broke and fell in five different spots, which became the Pancharama kshetras. The foremost of these is  Amaravati where Indra and the Devas are believed to have worshipped Shiva. The others are Bhimavaram,  Samalkota , Palakollu and draksharamam. Some beliefs  refer to Amararama, Draksharama, Somarama at Bhimavaram, Bhimarama or Kumararama at Samalkota  and Ksheerarama at Palakollu as the five Pancharama Kshetras, while some even refer to the Chalukya Bhimeswara temple at Bhimavaram as Bhimarama. Thus we also have Draksharama, Amararama, Kumararama at Kotipalli, Ksheerarama at Palakollu and Bhimarama at Bhimavaram constituting the five Pancharama kshetras. By all accounts Draksharama, Amararama and Ksheerarama housing tall columnar Shivalingams fall in to the scheme of all classifications.  Kumararama at Samalkota houses a tall Shivalingam too and so do Somarama and the Bhimeswara temples at Bhimeswaram. Thus six temples fall into this classification with unique features common to the Pancharama temples. Although sources refer to Kotipalli as Kumararama, its legends related to the river Godavari outweigh references to the Tarakasura vada myth. It is believed that the sivlingam that shattered into five pieces was a huge one, and the biggest of the five pieces is a fifteen foot long column of white marble which is worshipped as Amareswara at the Amaravati temple (this is very similar to the ten feet high Shivalingam at the Draksharama temple). While the Arupadai veedushrines represent the Soorasamhaara mythology  in Tamilnadu, the pancharama shrines are linked with the Taarakavada mythologyagain related to Skanda. Yet another legend has it that when Shiva destroyed the three Tripuras , all that was left was a Shivalingam, and that he divided it into five pieces and placed them for worship at the Pancharama shrines. It is also beleived that the Amaravati and the Draksharama shrines were originally centers of Buddhist worship. Yet another legend links the pancharama kshetras. The five Shivalingams worshipped at these shrines are said to be a part of a single said to have been created by  the Sun God. This original Shivalingam is said to have been held in worship by the seven rishis - Kasyapa, Atri, Gowtama, Kousika, Bharadwaja, Vasishta and Jamadagni. These rishis are believed to be present in the seven tributaries of Godavari, of which the Bharadwaja, Kousika and Jamadagni Godavaris are not in existence anymore. It is believed that the seven rishis brought water into the Godavari river from their points of origin. It is also believed that the waters from the seven tributaries constitute the water sources in the temple tank.