During the 18th century, the Kurdish emirate of Baban came into power in the Shahrizor area. Its capital city was Sulaymaniyah. In 1821, the emir of Baban defected from the Ottoman Empire to the Qajar Empire. The emir started to help Abbas Mirza, the crown prince of Iran and the Qajar governor of Azerbaijan. The emir's defection caused a war to start between the Ottomans and the Qajars (the 1821–1823 Ottoman–Persian War).