to renovate the temple, there were two idols of the god. The actual was, therefore, determined with some difficulty and reinstated with due ceremony and a small chamber was built in the temple to the Surathani or the Muslim princess who is worshipped as "Thulukkachi Nachiyar". The idol of the goddess buried under a bilva tree within the complex was also recovered and reinstated. Late Medieval Period The Delhi Sultanate managed to establish complete sovereignty over the Pandyan kingdom by 1327. The province of Ma'bar was created and ruled by viceroys appointed by Delhi. In 1335, the then viceroy, Jalaluddin Ahsan Khan declared his independence and founded the Madurai Sultanate. The early sultans had to deal with frequent incursions by Hoysala rulers. The attacks ended with the death of the Hoysala king Veera Ballala III at Tiruchirappalli in 1343. By the middle of the 14th century, the Madurai Sultanate had begun to decline. Gradually, the Vijayanagar Empire began to establish their control over the northern parts of the kingdom. Tiruchirappalli was taken by the Vijayanagar prince Kampanna Udaiyar in 1371. Following the reconquest, the dilapidated Ranganathaswami temple at Srirangam was restored to its former glory. Madurai, the capital was later taken and by 1378, the Madurai Sultanate had ceased to exist. The Vijayanagar Empire ruled the region from 1378 till the 1530s. Its rule was characterised by the revival of Hinduism and reconstruction of temples and monuments destroyed by the Muslim rulers. The province of Madurai was created and ruled by a viceroy or Nayak appointed by the Vijayanagar kings. Tiruchirappalli under Nayak rule When the Vijayanagar Empire began to decline in the early 1500s, the Nayaks began to assert their independence. The first independent Madura Nayak king was Viswanatha Nayak who ruled from 1538 to 1563. The Tiruchi range comprised five major paalayams: Udayarpalayam, Ariyalur, Marungapuri, Thuraiyur and Cuddalore. They constructed new mandapams at several temples, including the Srirangam Sri Ranganathaswamy Temple, and the Rock Fort. In 1616, Muttu Virappa Nayak moved the capital from Madurai to Tiruchirappalli. In the 1623 civil war in the Vijayanagar Empire, Muttu Virappa Nayak supported Jagga Raya, a claimant to the throne against Yachama a rival claimant. In the battle fought at Toppur near Tiruchi, Jagga Raya was defeated and killed while Muttu Virappa Nayak was captured. In Muttu Virappa's absence, his son Thirumalai Nayak was crowned king. Thirumalai Nayak moved the seat