By the end of the fifteenth century, the Qadiriyya had distinct branches and had spread to Morocco, Spain, Turkey, India, Ethiopia, Somalia, and present-day Mali. Established Sufi sheikhs often adopted the Qadiriyya tradition without abandoning leadership of their local communities. During the Safavid dynasty's rule of Baghdad from 1508 to 1534, the sheikh of the Qadiriyya was appointed chief Sufi of Baghdad and the surrounding lands. Shortly after the Ottoman Empire conquered Baghdad in 1534, Suleiman the Magnificent commissioned a dome to be built on the mausoleum of Abdul-Qadir Gilani, establishing the Qadiriyya as his main allies in Iraq.