Ay was a dynasty which controlled the south-western tip of the Indian peninsula, from the early historic period up to the medieval period.The clan traditionally held sway over the harbour of Vizhinjam, the fertile region of Nanjinad, and southern parts of the spice-producing Western Ghat mountains. The dynasty was also known as Kupaka in medieval period. The Ay formed one of the major chieftains of early historic (pre-Pallava) Kerala, along with the Cheras of central Kerala and the Musakas of Elimalai in the north. Greek geographer Claudius Ptolemy (2nd century AD) described the "Aioi" territory as extending from the Baris (Pamba) to Cape Comorin (Kanyakumari). The elephant was the emblem of the Ay. The medieval Ay lineage has its origins in the hill-chiefs of early historic (pre-Pallava) south India. The Ay kingdom functioned as a buffer state between the powerful Pandyas/Cholas and the Cheras (Kerala) in the medieval period. A number of kings such as Chadayan Karunanthan (788 AD), Karunanthadakkkan "Srivallabha" (r. c. 856/57–884), and Vikramaditya "Varaguna" (r. c. 884–911/920 AD) figure as the Ay chiefs of the harbour of Vizhinjam. The famous Brahmin salai at Kantalur, somewhere near present-day Trivandrum, was located in the Ay kingdom. The salai was sacked by Chola emperor Rajaraja I (985–1014 AD) in c. 988 AD. Historians assume that the Ay were a leading power in the region till c. 10th century AD. In his introduction to Lilathilakam, Attur Krishna Pisharodi in giving an account of Chiravayi says that the Ayar family who were ruling the regions near Ayakkudi (in Shencotta) and other places, were defeated by the Pandyas in the 8th century A.D. and they migrated to Vizhinjam, a sea port eight miles south-east of Trivandrum. The Ay kings continued to cherish their association with the Yadu-kula and Krsna in the later times also as seen in their copper plate grants and inscriptions. The medieval Ay claimed that they belonged to the Yadava or Vrishni lineage and this claim was advanced by the rulers of Venad and Travancore.