The Afrasiyab or Chalavi dynasty was a small Iranian Shia dynasty of Mazandaran and flourished in the late medieval, pre-Safavid period; it is also called the Kia dynasty. It was founded by Kiya Afrasiyab, who conquered the Bavand kingdom in 1349 and made himself king of the region. In 1504, Ismail I invaded Mazandaran and ended Afrasiab rule of the region.