Parvati, the consort of Shiva was doing penance under the temple's ancient Mango tree near Vegavathi river. In order to test her devotion Shiva sent fire on her. Goddess Parvati prayed to her brother, Vishnu for help. Vishnu took the crescent from Shiva's head and reflected the rays which then cooled down the tree as well as Parvati. Shiva wanted to test Parvati again and sent the river Ganga (Ganges) to disrupt her penance.
Parvati prayed to Ganga and convinced her that both of them were sisters and so she should not harm her. Subsequently, Ganga did not disturb her penance and Parvati made a Shiva Linga out of sand to get united with Shiva. Shiva came to be known as Ekambareswarar or "Lord of Mango Tree" and Vishnu as Nilathingal Thundam.
As per Hindu legend, Parvathi was doing penance at this place to attain the blessings of her husband Shiva. She sought the help of Vishnu to help her in the cause. Vishnu appeared as Vamana with a conch and disc and radiated light as moon. It is believed that Vishnu appeared for Chandra (moon) and Shiva.
As per another legend, when Devas (celestial deities) and Asuras (demons) were churning the Ocean of Milk, Vishnu helped them as a tortoise Kurma holding the mount. The snake Vasuki using as a rope for churning emanated poison that turned the skin colour of the tortoise from blue to black. Vishnu reached out to Brahma for resolution, who advised him to worship Shiva. It is believed that Sun and moon are the two eyes of Shiva. He opened his left moon eye to ease the pain of Vishnu with the cold lunar rays. On account of it, the presiding deity came to be known as Nilathingal Thunda Perumal.
The Ekambareswarar temple is one of the most ancient in India having been in existence since at least 600 CE. A 2nd-century CE Tamil poetry speaks of Kama kottam, and the Kumara kottam (currently the Kamakashi Amman temple and the Subramanya temple). Initially temple was built by Pallavas. The Vedantist Kachiyapper served as a priest at the temple.
The existing structure then, was pulled down and rebuilt by the later Chola Kings. Adi Sankara, the 10th-century saint got Kanchipuram remodeled along with expansion of this temple along with Kamakshi Amman temple and Varadaraja Perumal Temple with the help of local rulers.The Vijayanagar kings, during the 15th century, also made lot of contributions to the temple and later developed by Vallal Pachiyappa Mudaliar used to go regularly from Chennai to Kanchipuram to worship in this temple, he spent significant money he amazed during British rule on the temple renovation, Pachiyappa Mudaliar seated at horse back can be seen in the temple pillar. At the later stage a similar temple with same name Ekambareswarar was constructed in Chennai by Pachiappa Mudaliar in order to avoid travelling time to Kanchipuram.
The Archaeological Survey of India report of 1905–06 indicates widespread renovation activities carried out in the temple by Nattukottai Chettiar. In modern times, the temple is maintained and administered by the Hindu Religious Unlike other Vishnu temples that have Vaishnavite priests, this temple has only Saivite priests as the temple is located on the premises of a Shiva temple. There are no separate festivals celebrated for the presiding deity.The temple is revered in Nalayira Divya Prabandham, the 7th–9th century Vaishnava canon, by Thirumangai Azhwar in one hymn. The temple is classified as a Divyadesam, one of the 108 Vishnu temples that are mentioned in the book.
The consort of Nilathingal Thundam Perumal (also called Chandrasoodeswarar Perumal) is called Nilathingal Thunda Nayagi (also called Ver Oruvar Illa Valli). The temple is one of the three rare Divyadesams, with the other being Govindaraja Perumal Temple and Thirukalvanur, that are housed in a Shiva temple.Only Saivite priests perform rituals in the temple.and Endowment Board of the Government of Tamil Nadu.
Nilathingal Thundathan Perumal Temple is also called Nilthingal Thundam Perumal Temple and Chandrasoodeswarar Perumal Temple is a 1000 years old temple located in Kanchipuram District, Tamil Nadu. This is one of the 108 Divya Desams of Sri Vishnu, here all poojas are performed by the Saivite priests. This Vishnu temple is located on the North-East corner inside Ekambareshwarar temple and is a small Sannadhi. Here the Lord is called by Thiru Nilathingal Perumal, which means Lord who blesses devotees in moon color.
The deity will be seen here in a standing posture and is facing towards the West under Purushasuktha Vimanam with his abaya Hastham. Here the mother is worshipped as Ner Oruvar Illa Valli Nachiyar(Nilaatthingal Thunda thaayar).
This Vishnu temple is inside the Shiva temple. This is the only Divyadesams where Saivite Priests perform poojas. The place is called Thiruneduthangadam. This temple is one of the oldest temples dating back to 600 AD. built by the Pallava kings; Kings of the Chola dynasty also made abundant contributions to this temple. The tallest majestic Rajagopuram in this temple was built by Vijayanagara King Sri Krishna Devaraya. The most attractive thousand pillars of Mandap were also the contributions of the Vijayanagara kings.
Lord Perumal blesses His devotees seeking child boon. Those suffering from skin and stomach diseases and any adverse evil effects and excessive heat in the body pray to Perumal and for child boon. Perumal darshan also ensures affinity between mother and son.