Shiva, Vishnu and Brahma (Great Trinity) Temples, Chola Mandala

Hara Saabha Vimochana Perumal Temple in Thirukandiyur, Dinamalar
 In the Hindu Mythology, there are countless legends about the gods and goddesses in the pantheon and they  mostly revolve around the temple history. They carry a streak of moral lesson  and bring out the truth that like humans, gods  are susceptible to making glaring mistakes and sins, which when committed knowingly or unknowingly, even they are also bound to make amends to be absolved of sins. Such stories inculcate in us a moral responsibility to be upright, honest and be careful about our actions, especially the bad ones that may affect the people around us. Hence, discretion is very important before any action verbal or physical. Therefore, it is imperative to  keep our mind in check. Wrong decision without second thoughts means one must be ready to face the repercussions in the aftermath. At Thirukandiyur Lord Shiva who  himself committed sin ultimately repented  and was relieved by Lord MahaVishnu.

In Hinduism three gods - The Great Trinity are very important and they  are Vishnu (Narayana - protector), Shiva (Sankara - destroyer) and Brahma (creator). A perusal of Hindu temples across India would reveal the fact that that are  very  few places where the Great trinity  are worshiped on the same premises In Suchindram, near Nagercoil (Kanyakumari district) the idol of Shiva  and in Thirukkannapuram, near Nannilam, Tamil Nadu the idol of Vishnu  are  believed to be symbolic of  the Trinity. In the North, there is a separate temple for Lord Brahma at Pushkaram, Rajasthan. In the heartland of Chola Nadu Bikshandarkoil (Uttamar Kovil), near Tiruch and Thirukandiyur, near Thanjavur are two places where Shiva, Vishnu and Brahma are worshiped in the same place. An interesting fact emerges that these two places  have a close link with Shiva's curse and his salvation from sin  by Lord Vishnu.

Hara Saabha Vimochana Perumal Temple in Thirukandiyur, a small village,  about 11kms from Thanjavur, on the way to  Thiruvayaru and Ariyalur in Tamil Nadu has a famous temple dedicated to  the Hindu god  Vishnu. It is one of the 108 Divyadesam dedicated to Vishnu, and the temple is glorified in the Divya Prabandham, the early medieval Tamil canon of the Azhwar saints from the 6th–9th centuries AD.  Built in the Dravidian style of architecture, Vishnu, here  is worshiped as Hara Saabha Vimochana perumal  since he  gave relief  to Shiva (relief:  Vimochana; the sin: saabha of Shiva also called Hara).  His consort is Lakshmi as Kamalavalli Thayyar. Utchavar is Kamalanathan. Moolavar _perumal is in standing posture, facing east.  The Vimana (small tower) above the sanctum is called Kamalakruthi Vimana.

The main gateway - Raja gopuram - tower has five levels (tiers). The temple is said to have been built by the Medieval Cholas of the late 8th century AD. Additional contributions were made by the  Vijayanagar kings and Madurai Nayak rulers. A granite wall is built around the temple, enclosing all its shrines and  water tank.  This temple is located in between the rivers Cauvery and Kodamuruti.
Hara Saabha Vimochana Perumal Temple in Thirukandiyur,Tamilnadu Tourism
Legend has it, both Brahma, the Hindu god of creation and Shiva, the Hindu god of destruction, had originally five heads. Parvathi, the wife of Shiva, thinking she was performing   patha pooja (ablution of feet, considered an act of prayer and respect) to her husband Shiva, did it to Brahma instead over which  Shiva (whose 5 heads are  Eeshana, Tatpurusha, Agora, Vamadevam and Satyojatham) became angry and cut off  the middle head  of Brahma. The removed head got stuck in  Shiva's hand owing to a curse  of Brahma. To absolve of  the sin as a result of Brahmahathi Dosham , Shiva  went around begging and at Karambarnur Lord Vishnu  asked Poorva Devi to offer Shiva Bhiksha which she did. It partially removed Shiva's sin but Brahma Kapalam, to his dismay, got stuck on the palm  and the food served on the skull failed to fall down. Again, upon Vishnu's advice, Shiva went to Thirukandiyur where he got complete salvation from the sin after taking a holy dip in the temple tank called  Kamala Pushkarani.  Since Vishnu gave salvation from curse here,  he is called  Hara Saabha Vimochana perumal. After this incident, the tank came to be known as Kapala Theertham (kapala means skull). It is believed that Shiva was pleased and he built the Hara Sabha Vimochana temple as a token of his gratitude to Lord Vishnu.

Besides, Lord Shiva built a temple for himself near this place - Brahma Sira Kandeeswarar temple which is one of the 275 Paadal Petra Sthalams. Thirugnana Samandar, a well-known  Tamil Saivite seer  sang in glory of this temple. Lord's consort is Mangalambigai. In the Tamil month of Vaikasi the act of Shiva punishing Brahma is enacted as part of the festival. It is the fifth of the seven sapthastanas of Aiyarappar temple at Tiruvaiyaru.  Tamil saint poets, Appar and Samandar  of the 7th century sang devotional hymns and glorified this temple. The holy tree is vilvam and the holy water source is Brahma Theertham. In the Tamil month of Masi, on the 13th, 14th and 15th  the Sun's rays fall on the Sivalingam in the Grabagraha - sanctum sanctorum. There are shrines for Bhairavar, Suryan, Vinayaka, Skanda, Ardhanareeswara and Vishnu Durgai. There was a separate temple for Brahma, but it fell into ruins over a period of time and  the idols of Brahma and Saraswati are kept in the Siva Temple.
Brahma Sira Kandeeswarar temple,Kandiyur en.wikipedia.or
According to another legend once  Lakshmi, the consort of Vishnu, not happy with her husband because he was paying more attention to Brahma, the God of creator, requested Shiva to cut off one of the heads of Brahma. Shiva did exactly what he had been told. At last Vishnu came to Shiva's rescue and got rid of his sin. It is believed that Sage Bhrigu, King Mahabali and Chandra (Moon) all got their sins relieved  by worshiping Hara Saabha Vimochana Perumal. Thirumangai Azhvaar (Paasuram-2050) sang in glory of this temple and among the 108 Divya Desa shrines, this one is 15th.

Brahmostavam, celebrated during the Tamil month of Panguni (April–May), Aipasi Pavithra Utsavam in Aipasi (October–November), Vaikunta Ekadashi in Margazhi (December–January) and Karthikai Deepam in Karthikai (November–December)

Ref:
 https://en.wikipedia.org/wiki/Hara_Saabha_Vimocchana_Perumal_Temple