Tahmasp I
During the reign of Ismail I and his son, Tahmasp I, Shia Islam was imposed upon the Sunni population of Iran and Azerbaijan. The conversion was especially harsh in Shirvan, where many Sunnis were massacred. Safavid Iran became a feudal theocracy during this period, and the shah was held to be the divinely-ordained head of the state and its religion. The Qizilbashi chiefs were designated "wakils" (provincial administrators), and the position of "ulama" was created. Wars with the rival Sunni Ottoman Empire continued during the reign of Tahmasp I, and the Safavid cities of Shamakha, Ganja, and Baku were occupied by the Ottomans during the 1580s.