History of Madurai district connects it to an interesting legend by which the district got its name. As per the legend, the place was originally a forest called Kadambavanam. Once, a farmer called Dhananjaya noticed Lord Indra worshipping the swayambhu or the self-created Lingam under a Kadamba tree, while he was passing through the forest. He informed the incident to the King Kulasekara Pandya. Then the King cleared the forest and constructed a temple around the Lingam and settlements were also planned around the temple. On the very day of naming the place, Lord Shiva is said to have presented himself there and drops of nectar from his hair fell on that place. Thus the name of the place became Madurai, which means sweetness in Tamil.
Madurai has a rich historical background in the sense that Lord Shiva himself performed sixty four wonders called `Thiruvilaiyadals`. As early as the third century BC, Megasthanes visited Madurai. Later, several people from Rome and Greece visited the district of Madurai and set up trade links with the kings of the Pandya dynasty. The district of Madurai flourished till the tenth century AD when it was captured by Cholas, the arch rivals of the Pandyas. The Cholas ruled over Madurai from AD 920 till the beginning of the thirteenth century. In AD 1223, the Pandyas regained their kingdom and once again became prosperous. The Pandian Kings patronized Tamil language in a great way and in their period many master-pieces were created. `Shilapaddikaram`, the great epic in Tamil was written based on the story of Kannagi who burnt Madurai as a result of the injustice caused to her husband Kovalan. In the month of April 1311, Malik Kafur, the general of Ala-ud-din Khilji, the then ruler of Delhi, reached Madurai and raided and robbed the city for precious stones, jewels, and other rare treasures. This led to the subsequent raids by other Muslim Sultans. In 1323, the Pandya kingdom including Madurai became a province of the Delhi Empire under the Tughlaks.
The Vijayanagar dynasty of Hampi captured Madurai in 1371 and the district became a part of the Vijayanagar Empire. Kings of this dynasty used to leave the captured land to governors called Nayaks. This was done for the efficient management of their empire. The Nayaks paid fixed amount annually to the Vijayanagar Empire. After the death of Krishna Deva Raya, the King of Vijayanagar Empire, in AD 1530, the Nayaks became independent and ruled the territories under their control. Among Nayaks, Thirumalai Nayak was very popular; even now he is popular among people, since he contributed to the creation of several magnificent structures in and around Madurai. The Raja Gopuram of the Meenakshi Amman temple, the Pudu Mandapam and the Thirumalai Nayakar`s Palace are living monuments to his artistic fervour.
The district of Madurai started to slip into the hands of the British East India Company. In the year 1781, British appointed their representatives to look after Madurai. George Procter was the first collector of Madurai. After the Indian independence, Madurai became one of the most prominent districts of the state of Tamil Nadu in India. In the year 1985, the vast Madurai district was bifurcated into two districts called Madurai and Dindigul district. Subsequently in the year 1997, Madurai district was again bifurcated into two districts called Madurai and Theni district. In Madurai district, there are ten state assembly constituencies and two parliamentary constituencies.