The Kayanians (also Kays, Kayanids or Kaianids, or Kiani) are a legendary dynasty of Persian tradition and folklore which supposedly ruled after the Pishdadians. Considered collectively, the Kayanian kings are the heroes of the Avesta, the sacred texts of Zoroastrianism, and of the Shahnameh, Iran's national epic.
As an epithet of kings and the reason the dynasty is so called, Middle and New Persian kay(an) originates from Avestan kavi (or kauui) "king" and also "poet-sacrificer" or "poet-priest". The word is also etymologically related to the Avestan notion of kava?m khar?no, the "divine royal glory" that the Kayanian kings were said to hold. The Kiani Crown is a physical manifestation of that belief.
The earliest known foreshadowing of the major legends of the Kayanian kings appears in the Yashts of the Avesta, where the dynasts offer sacrifices to the gods in order to earn their support and to gain strength in the perpetual struggle against their enemies, the Anaryas (non-Aryans, sometimes identified as the Turanians).
In Yasht 5, 9.25, 17.45-46, Haosravah, a Kayanian king later known as Kay Khosrow, together with Zoroaster and Jamasp (a premier of Zoroaster's patron Vishtaspa, another Kayanian king) worship in Airyanem Vaejah. The account tells that King Haosravah united the various Aryan (Iranian) tribes into one nation (Yasht 5.49, 9.21, 15.32, 17.41).
Towards the end of the Sassanid period, Khosrow II (590-628, named after the Kay Khosrow of legend) ordered a compilation of the legends surrounding the Kayanians. The result was the Khwaday-Namag or "Book of Lords," a long historiography of the Iranian nation from the primordial Gayomart to the reign of Khosrow II, with events arranged according to the perceived sequence of kings and queens, fifty in number.
The compilation may have been prompted by concern over deteriorating national spirit. There were disastrous global climate changes of 535-536 and the Plague of Justinian to contend with and the Iranians would have found much-needed solace in the collected legends of their past.
Following the collapse of the Sassanid Empire and the subsequent rise of Islam in the region, the Kayanian legends fell out of favour until the first revival of Iranian culture under the Samanids. Together with the folklore preserved in the Avesta, the Khwaday-Namag served as the foundation of other epic collections in prose, such as those commissioned by Abu Mansur Abd al-Razzaq, the texts of which have since been lost. The Samanid-sponsored revival also led to the resurgence of Zoroastrian literature, such as the Denkard, book 7.1 of which is also a historiography of Kayanians. The best known work of the genre is however Firdowsi's Shahnameh "Book of Kings", which - though drawing on earlier works - is entirely in verse.