 Krishnadevaraya (1509–29), the emperor of Vijayanagara visited the town in 1524 and is believed to have bathed in the famous Mahamaham tank during the Mahamaham festival.Kumbakonam was ruled by the Madurai Nayaks and the Thanjavur Nayaks from 1535 to 1673 when it fell to the Marathas.Each of these foreign dynasties had a considerable impact on the demographics and culture of the region.