During the 14th and 15th centuries, the traditional chieftain of the region who belonged to the Maravar caste was officially recognized as "Sethupathi" by the Nayak king of Madurai. The chieftain of Ramnad, in return, recognized the sovereignty of the Nayak king over his lands. When the power of the Nayak kings of Madurai began to decline in the late 17th century, the chieftains of Ramnad asserted their independence. In the late 17th century, Raghunatha Kilavan crowned himself king of Ramnad and changed his seat from Pogalur to Ramnad close to the east coast. He erected massive fortifications to protect his capital. In 1725, the king of Tanjore claimed the northern part of the Ramnad kingdom (the Aranthangi region) up to the river Pambar in return for his services during the civil war in Ramnad. A vassal of Ramnad who was amongst the victors in the civil war took over the westerly located Sivaganga region, thereby leaving only three-fifths of the kingdom actually in the hands of the king of Ramnad. At the beginning of the 18th century, family disputes over succession resulted in the division of Ramanathapuram. With the help of the King of Thanjavur in 1730, one of the chieftains deposed the Sethupathi and became the Raja of Sivaganga.