Indra, God of heaven who came to The Earth to perform penance for Lord Siva, reached Kadamba forest, the present Madurai. His followers did a search in this place and found a small Siva Linga and informed Indra on the same. Indra did penance here and offered prayers to this self-manifested Linga to get out his sinful deed (Killing Brahman).
A merchant from Manavur, by name Dhananjaya, took a night halt at the temple built by Indra. Next day morning, he is surprised to see that the Siva Linga had been worshipped by the flowers. Merchant informed the Pandya King Kulasekara about the miracle. Knowing this King ordered his staff to built a temple and a town at this place.
His heir Malayadhvaja Pandya and His Wife Kanchanamala performed Putra Kameshti Yajna, while the Yajna was progressing a 3-year-old girl born out the holy fire, walked out and sat on the lap of Queen Kanchamala. The girl with eyes likes a fish had three nipples on her chest. The king and queen were upset on seeing the abnormality, a divine voice informed the King and the Queen that "raise her like a boy with all skills, the third nipple will disappear when she meets her future husband".
As advised, they named the girl "Thadhathagai" and ascended throne after her father's death. She expanded the kingdom and declared war on three worlds, conquered Satyaloka (Brahma's abode), Vaikuntam (Lord Vishnu's abode) , Amaravathi (Deva's abode) and advanced to Kailash to take on Siva. When she came face to face with Siva, her third breast vanished and in shyness bowed her head down. She realized that Siva is here destined Husband.
Another version, It was Indra who ran to Kailash seeking residence when Amaravathi was conquered. When Thadathagai reached Kailash, encountered Siva, and her third breast disappeared. Siva told her to return to Madurai and anticipate his arrival. Lord Siva arrived Madurai after 8 days and the celestial wedding took place.
Lord Vishnu, could not reach the hall in time and the marriage went on without him. On knowing this, he stopped at the banks of Vaigai and manifested himself as Kallazhagar.