A Second Chera Kingdom (c. 800–1102), also known as Kulasekhara dynasty of Mahodayapuram, was established by Kulasekhara Varman, which ruled over a territory comprising the whole of modern Kerala and a smaller part of modern Tamil Nadu. During the early part of Kulasekara period, the southern region from Nagerkovil to Thiruvallawas ruled by Ay kings, who lost their power in the 10th century, making the region a part of the Kulasekara empire. During Kulasekhara rule, Kerala witnessed a developing period of art, literature, trade and the Bhakti movement of Hinduism. A Keralite identity, distinct from the Tamils, became linguistically separate during this period. For the local administration, the empire was divided into provinces under the rule of Naduvazhis, with each province comprising a number of Desams under the control of chieftains, called as Desavazhis.
The inhibitions, caused by a series of Chera-Chola wars in the 11th century, resulted in the decline of foreign trade in Kerala ports. Buddhism and Jainism disappeared from the land. The social system became fractured with internal divisions on the lines of caste. Finally, the Kulasekhara dynasty was subjugated in 1102 by the combined attack of Later Pandyas and Later Cholas. However, in the 14th century, Ravi Varma Kulashekhara (1299–1314) of the southern Venad kingdom was able to establish a short-lived supremacy over southern India. After his death, in the absence of a strong central power, the state was divided into thirty small warring principalities; most powerful of them were the kingdom of Samuthiri in the north, Venad in the south and Kochi in the middle. Later in the 18th Century, Travancore King Sree Anizham Thirunal Marthanda Varma annexed all kingdoms up to Northern Kerala through military conquests, resulting in the rise of Travancore to a position of pre-eminence in Kerala. The Kochi ruler sued for peace with Anizham Thirunal, Malabar came under direct British rule until the Independence of India.