senior general and a son of the vassal prince of Osrūšana, to defeat Babak. Al-Mutasim set a price and allowances for Afshin that were unusually high. According to Said Nafisi, Afshin managed to attract Babak's spies on his side by paying much more than Babak. When Afshin knew that Babek was aware that Boḡā the Elder had been sent a large amount of money by Afshin and was preparing to attack Boga, he used that information to pressure Babak into full co-operation, managed to have Babak's comrades killed and let Babak flee to Badd. Before Afshin's departure, the caliph had sent a group under Abū Saʿīd Moḥammad to rebuild the forts demolished by Babak between Zanjān and Ardabīl. The Khurramites, led by Moʿāwīa, made a failed attack on the Arabs that was recorded by al-Tabari as Babak's first defeat. The last battle between the Abbasid caliphate and the Khurramites occurred in Badd Fort on 837. The Khurramites were defeated, and Afšīn reached Badd Fort. After capturing Badd Fort, Babak went to near the Araz River. His goal was to join the Byzantine emperor, gather new forces and continue the struggle. Thus, it was announced that al-Mutasim would give a reward of two million dirhams to whoever handed Babak over alive. Babak's former ally, Sahl ibn Sumbat, handed Babak over to the Abbasids, and on March 14, 838, Babak was executed in the city of Samira. The Abbasid suppression of the rebellion led to the flight of many thousands of Khurramites to Byzantium, where they were welcomed by Emperor Theophilos, and they joined the Byzantine army under their Iranian leader, Theophobos. Beliefs Al-Maqdisi mentions several facts. He observes that "the basis of their doctrine is belief in light and darkness"; more specifically, "the principle of the universe is Light, of which a part has been effaced and has turned into Darkness". They "avoid carefully the shedding of blood, except when they raise the banner of revolt". They are "extremely concerned with cleanliness and purification, and with approaching people with kindness and beneficence". Some of them "believed in free sex, provided that the women agreed to it, and also in the freedom of enjoying all pleasures and of satisfying one's inclinations so long as this does not entail any harm to others". (their name is most frequently derived from the Persian word khurram "happy, cheerful"). Regarding the variety of faiths, they believe