 Afshin Kavus, son of the Afshin Karākana who had submitted to Fadl ibn Yahya, withdrew his allegiance from the Arabs; but shortly after Ma'mun arrived in Baghdad from the east (817-18 or 819-20), a power struggle and dissensions broke out among the reigning family of Oshrusana.Kawus' son Khaydar, known by his royal title of Afshin, became a general in the Abbasid army and fought against Khurramite rebels and their leader Babak Khoramdin in Azerbaijan (816-837).In 841 Afshin was arrested in Samarra on suspicion of plotting against the Caliphate.