Diyar Bakr encompasses the region on both banks of the upper course of the river Tigris, from its sources to approximately where its course changes from a west-east to a southeasterly direction. Its main city was Amida (Amid in Arabic), and other major settlements included Mayyafariqin, Hisn Kaifa, and Arzan. Geographically and politically, in early Islamic times the Diyar Bakr was usually part of the Jazira, but it was sometimes joined to the Armenian province to the north. In the late 9th century, it was controlled by an autonomous dynasty founded by Isa ibn al-Shaykh al-Shaybani. In the mid-10th century, the region passed into the hands of the Hamdanids, but their rule was contested by the Buyids (978–983) and after that the Marwanids. The Marwanid emirate ruled the region for almost a century before being annexed by the Seljuq Empire in 1084–1085. Following the Seljuq realm's collapse after the death of Malik-Shah I in 1092, a series of small emirates established itself across the region, with the Artukids of Mardin the most important among them. In the late 12th century, the province came under Ayyubid control, and in the mid-13th century it was divided between the Ayyubids in the east and the Seljuqs of Rum, who controlled the western portion around Amida. Around 1260, the region was conquered by the Mongols, who allowed the local rulers to continue to exercise power as their vassals. In the 14th century, the region was conquered by the Ak Koyunlu, who disputed control with the Kara Koyunlu and the last Ayyubid princes. In the early 16th century, it was for a time occupied by the Safavids before coming under Ottoman control in 1516.