Emirate of Derbent

Emirate of Derbent (امارة بَاب ٱلْأَبْوَاب) was a medieval state that arose on the Caspian trade route with its center in the city of Derbent. The latter occupied a key position among trade centers in the Caspian region. It was ruled by the Hashimid dynasty (Āl-e Hāšem), descendants of a freedman from the Banu Sulaym tribe.

Background
The first attack on Derbent by an Arab Caliphate was launched in 642 under Suraqa ibn Amr, according to al-Tabari. As a result, the city's Sassanid-appointed governor Shahrbaraz surrendered. Thereafter the city was used as a base by Arabs during the devastating Arab–Khazar wars. In 713–714, Arab general Maslama led an expedition which captured Derbent, reportedly after a resident showed him a secret underground passage. The Armenian historian Łewond claims that the Arabs, realizing that they could not hold the fortress, razed its walls. Future caliph Marwan II once garrisoned Derbent. Asid ibn Zafir al-Sulami and his son Yazid were also once in command of Derbent. A commander of Derbent, al-Munajjim al-Sulami (or Najm b. Hashim) was executed by Sa'id ibn Salm al-Bahili in 799, which prompted his son Hayyun to mount a revenge raid by the Khazars. Maskat was also annexed to governorate after 833.

History
The autonomous or independent emirate was formed in 869 by Hashim b. Suraqa b. Salis b. Hayyun, Hayyun's great-grandson, following the Anarchy at Samarra. The emirate's politics were influenced by guilds, important tribes and warrior caste (ghazi), often struggling with each other as kingmakers. The neighbouring Shirvanshahs also contested the emirs' sovereignty.

Hashim's rule lasted until 884 was followed by his descendants who continuously fought against the Khazars, the Rus', the Shirvanshahs and Sarir. The Hashimid dynasty fell from power in 1075 when Fariburz I annexed Derbent, but soon another dynasty emerged following Saljuq intervention, namely the Aghlabids, named after Aghlab b. Ali who was appointed by Seljuk commander Savtegin after his release from Shirvan prison. This dynasty was in power c. 1173 when Akhsitan I defeated emir Bek-Bars b. Muzaffar with his cousin George III ( r.  1156–1184), the king of Georgia.

Rulers
The Derbent emirate was mainly ruled by Hashimids, at times interrupted by Shirvanshah appointees:


 * 1) Hashim b. Suraqa (869 – 884)
 * 2) 'Omar b. Hashim (884 – 885)
 * 3) Muhammad b. Hashim (885 – December 915)
 * 4) Abd al-Malik I (4 January 916 – 24 February 939)
 * 5) * Abu’l-Naǰm b. Muhammad (claimant after 2 March 916)
 * 6) Ahmad b. Abd al-Malik I (27 February 939 – June 939)
 * 7) Haytham ibn Muhammad (son of Muhammad III of Shirvan)  (June 939 – May 941)
 * 8) Ahmad (2nd time, May 941 – December 941)
 * 9) Haytham ibn Muhammad (2nd time, December 941 – May 942)
 * 10) Ahmad of Shirvan (May 942 – September 953)
 * 11) Khashram Ahmad b. Munabbih (September 953 – March 954) — King of Lakz
 * 12) Ahmad (3rd time, March 954 – November 976)
 * 13) Maymun I b. Ahmad (November 976 – 990)
 * 14) Muhammad IV of Shirvan (990 – 991)
 * 15) Maymun I (2nd time, 990 – 27 February 997)
 * 16) Muhammad II b. Ahmad (27 February 997 – December 997)
 * 17) Lashkari I b. Maymun (March 998 – September 1002)
 * 18) Mansur I b. Maymun (1003 – 1019)
 * 19) Yazid ibn Ahmad (1019 – 1021)
 * 20) Mansur I (2nd time, 1019 – 1023)
 * 21) Yazid ibn Ahmad (2nd time, 1023 – 1024)
 * 22) Mansur I (3rd time, 1024 – 1034)
 * 23) Abd al-Malik II b. Mansur (deposed 9 February 1034)
 * 24) Ali II of Shirvan (9 February 1034 – April 1035)
 * 25) * Mansur b. Musaddid (as commander)
 * 26) Abd al-Malik II (2nd time, April 1035 – 10 March 1043)
 * 27) Mansur II b. Abd al-Malik II  (18 March 1043 – 22 September 1054)
 * 28) Lashkari II b. Abd al-Malik II  (22 September 1054 – 3 January 1055)
 * 29) Mansur II (2nd time, 1 July 1055 – 10 February 1065)
 * 30) Abd al-Malik III b. Lashkari II (May 1065 – October 1065)
 * 31) Afridun I (30 January 1066 – July 1068)
 * 32) Abd al-Malik III (2nd time, 27 October 1068 – 28 December 1068)
 * 33) Afridun I (2nd time,  28 December 1068 – 1070)
 * 34) Abd al-Malik III (3rd time, 1070 – 1071)
 * 35) Afridun I (3rd time,  1071 – January 1072)
 * 36) Abd al-Malik III (4th time, 1072 – 20 August 1075)
 * 37) Maymun II b. Mansur II (20 August 1075 – December 1075)

The emirate was eventually absorbed into the Seljuq Empire and later Shirvanshah state. However, around 1130-1150, the emirate was ruled by another dynasty according to Abu Hamid al-Gharnati:


 * 1) Sayf al-Din Muhammad b. Khalifa (before 1154)
 * 2) Muzaffar b. Muhammad (c. 1154 – 1164) — married to daughter of Demetrius I of Georgia
 * 3) Bek-Bars b. Muzaffar (c. 1173)
 * 4) Abd al-Malik IV b. Bek-Bars  (c. 1180)
 * 5) Rashid b. Farrukhzad (c. 1222)

The emirate was again absorbed into Shirvanshah state after 1225 but was finally annexed to Ilkhanate after the arrival of Hulagu Khan in the Middle East, who appointed his son Yoshmut to commander the march of Derbent in 1265.