Kekeya (also known as Kekaya, Kaikaya, Kaikeya etc.) is a kingdom grouped among the western kingdoms in the epic Mahabharata. The location of the ancient kingdom is approximately near Toba Tek Singh in modern Pakistan. The epic Ramayana also mentions Kekeya as a western kingdom. One of the wives of Dasharatha, the king of Kosala and father of Raghava Rama, was from Kekeya kingdom and was known as Kaikeyi. Her son Bharata conquered the neighbouring kingdom of Gandhara and built the city of Takshasila. Later the sons and descendants of Bharata ruled this region from Takshasila.
In Mahabharata, five Kekaya princes were mentioned, who joined the Pandavas in Kurukshetra War. The eldest of them was described as a king and was known as Vrihatkshatra. These Kekaya brothers were also banished from their kingdom by their own kinsmen, like the Pandavas who were bansished from their Kuru Kingdom, by their cousin brothers viz the Kauravas headed by Duryodhana. Thus these Kekaya brothers were circumstantially inclined to ally with the Pandavas. Besides this, the Kekaya brothers were sons of the sister of Kunti, the mother of Pandavas, making them cousins. In Kurukshetra War, the Kekaya brothers fought against their own kinsmen, viz the other Kekaya brothers who sided with Duryodhana.
Kekayas or Kaikeyas (Sanskrit: केकय) were an ancient people attested to have been living in north-western Punjab—between Gandhara and the Beas rivers in modern Pakistan since remote antiquity. They were the descendants of the Kshatriyas of the Kekaya Janapada hence called Kekayas or Kaikeyas. The Kekayas were often associated with the Madras, the Usinaras, and the Sibis, and their territory had formed a part of the Vahika country, according to the evidence furnished by Pāṇini.
Numerous Puranas include the Kekayas in the list of Gandharas, Yavanas, Shakas, Paradas, Bahlikas, Kambojas, Daradas, Barbaras, Chinas, Tusharas, Pahlavas, and call them as a people of Udichya i.e. of northern division or Uttarapatha. The Kekayas are said to have occupied the land now comprised by three districts of Jhelum, Shahpur and Gujerat, all in Pakistan.
The Rigvedic Kekayas dwelt on the banks of river Parusni (=Ravi). The king of Kekayas at the time of Janaka of Videha was Ashvapati i.e. lord of horses. Satapatha Brahmana and Chandogiya Upanishada suggest that Kekaya king Ashvapati had instructed a number of Brahmanas viz. Arjuna Aupavesi, Gautama, Satyajna Paulushi, Mahasala Jabala, Budila Asvatarashvi, Indradyumna Bhallaveya, jana Sarkarakshya, Prachinshala, Aupamanyava and Uddaalaka Aruni.