Kerala is first mentioned as "Keralaputra" in a 3rd-century BCE rock inscription by the Mauryan emperor Ashoka. The Ashoka Chakra, a prominent symbol associated with Emperor Ashoka, is featured on the Lion Capital of Ashoka and represents the principles of righteousness and moral governance that Ashoka promoted. The region gained fame among the Greeks and Romans for its spices, particularly pepper, during the late centuries BCE. Throughout the first five centuries CE, Kerala was part of Tamilakam, which was controlled by various Tamil dynasties, including the Pandya and Chola, as well as the Cheras. During this period, Jewish immigrants arrived, and Christian tradition holds that St. Thomas the Apostle visited Kerala in the 1st century CE.
From the 6th to the 8th century, Kerala's history is less documented, but it is known that Arab traders introduced Islam during this time. The Kulashekhara dynasty (c. 800–1102) played a significant role in Kerala’s history by fostering the emergence of Malayalam as a distinct language and promoting Hinduism. The Chola dynasty frequently controlled the region during the 11th and 12th centuries, and by the early 14th century, Ravi Varma Kulashekhara of the Venad kingdom established a brief dominance over southern India. After his death, Kerala fragmented into warring chieftaincies, including Calicut (now Kozhikode) in the north and Venad in the south.
The arrival of European powers began in 1498 when Vasco da Gama landed near Calicut, marking the start of foreign intervention. The Portuguese established dominance in the 16th century, but their sovereignty was contested by the zamorin of Calicut. In the 17th century, the Dutch replaced the Portuguese. Marthanda Varma, who became the ruler of Venad in 1729, successfully repelled Dutch expansion and expanded his domain, creating the southern state of Travancore. His alliance with the raja of Cochin in 1757 helped Cochin survive, but by 1806, both Cochin and Travancore, along with the Malabar Coast, came under British control as part of the Madras Presidency.
Following India's independence in 1947, Cochin and Travancore were merged to form the Travancore-Cochin state. In 1956, the present state of Kerala was established on a linguistic basis, incorporating the Malabar Coast and Kasargod taluka from South Kanara into Travancore-Cochin, while the southern part of the former Travancore-Cochin was attached to Tamil Nadu.