The legend of Cheraman Perumals is the medieval tradition associated with the Cheraman Perumals (literally the Chera kings) of Kerala.[21] The validity of the legend as a source of history once generated much debate among South Indian historians.[22] The legend was used by Kerala chiefdoms for the legitimation of their rule (most of the major chiefly houses in medieval Kerala traced its origin back to the legendary allocation by the Perumal).[23][24] According to the legend, Rayar, the overlord of the Cheraman Perumal in a country east of the Ghats, invaded Kerala during the rule of the last Perumal.