The Nellaiappar temple was the royal shrine of the later Pandyas during the 13th and 14th centuries, and the city benefited from dams constructed with royal patronage during the period. After the death of Kulasekara Pandian (1268–1308), the region was occupied by Vijayangara rulers and Marava chieftains (palayakarars, or "poligars") during the 16th century. The Maravars occupied the western foothills and the Telugas, and the Kannadigas settled in the black-soil-rich eastern portion. Tirunelveli was the subsidiary capital of the Madurai Nayaks; under Viswanatha Nayak (1529–64), the city was rebuilt about 1560. Inscriptions from the Nellaiappar temple indicate the generous contributions to the temple. Nayak rule ended in 1736.