Sivakasi was established during the early 15th century CE. Between 1428 and 1460, a Pandya king Harikesari Parakkirama Pandian ruled the southern part of Madurai region (comprising modern-day Sivakasi and its surroundings). Hindu legend relates that he wanted to construct a temple for the Hindu god Shiva at Tenkasi and went to Kasi to bring a lingam (an iconic representation of Shiva). While returning to his palace with the prized lingam, he rested under the grove of a vilva tree, the favourite tree of Shiva. When a cow carrying the lingam refused to move from the spot, the king realised that the wishes of Shiva were different from his own, and he placed the lingam in the place where the cow halted. The place where the Shiva lingam brought from Kasi was installed came to be known as Sivakasi. Sivakasi was a part of the Madurai region during the 16th century. Madurai became independent from the Vijayanagar Empire in 1559 under the Nayaks. Nayak rule ended in 1736 and Madurai was repeatedly captured several times by Chanda Sahib (1740 - 1754), Arcot Nawab and Muhammed Yusuf Khan (1725 - 1764) in the middle of the 18th century. In 1801, Madurai came under the direct control of the British East India Company and was annexed to the Madras Presidency.