# Emirate of Derbent

Emirate of Derbent (Arabic: امارة بَاب ٱلْأَبْوَاب, romanized: Imārat Bāb al-Abwāb) 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:
* Hashim b. Suraqa (869 – 884)
* 'Omar b. Hashim (884 – 885)
* Muhammad b. Hashim (885 – December 915)
* Abd al-Malik I (4 January 916 – 24 February 939)
** Abu’l-Naǰm b. Muhammad (claimant after 2 March 916)
* Ahmad b. Abd al-Malik I (27 February 939 – June 939)
* Haytham ibn Muhammad (son of Muhammad III of Shirvan) (June 939 – May 941)
* Ahmad (2nd time, May 941 – December 941)
* Haytham ibn Muhammad (2nd time, December 941 – May 942)
* Ahmad of Shirvan (May 942 – September 953)
* Khashram Ahmad b. Munabbih (September 953 – March 954) — King of Lakz
* Ahmad (3rd time, March 954 – November 976)
* Maymun I b. Ahmad (November 976 – 990)
* Muhammad IV of Shirvan (990 – 991)
* Maymun I (2nd time, 990 – 27 February 997)
* Muhammad II b. Ahmad (27 February 997 – December 997)
* Lashkari I b. Maymun (March 998 – September 1002)
* Mansur I b. Maymun (1003 – 1019)
* Yazid ibn Ahmad (1019 – 1021)
* Mansur I (2nd time, 1019 – 1023)
* Yazid ibn Ahmad (2nd time, 1023 – 1024)
* Mansur I (3rd time, 1024 – 1034)
* Abd al-Malik II b. Mansur (deposed 9 February 1034)
* Ali II of Shirvan (9 February 1034 – April 1035)
** Mansur b. Musaddid (as commander)
* Abd al-Malik II (2nd time, April 1035 – 10 March 1043)
* Mansur II b. Abd al-Malik II (18 March 1043 – 22 September 1054)
* Lashkari II b. Abd al-Malik II (22 September 1054 – 3 January 1055)
* Mansur II (2nd time, 1 July 1055 – 10 February 1065)
* Abd al-Malik III b. Lashkari II (May 1065 – October 1065)
* Afridun I (30 January 1066 – July 1068)
* Abd al-Malik III (2nd time, 27 October 1068 – 28 December 1068)
* Afridun I (2nd time, 28 December 1068 – 1070)
* Abd al-Malik III (3rd time, 1070 – 1071)
* Afridun I (3rd time, 1071 – January 1072)
* Abd al-Malik III (4th time, 1072 – 20 August 1075)
* 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:
* Sayf al-Din Muhammad b. Khalifa (before 1154)
* Muzaffar b. Muhammad (c. 1154 – 1164) — married to daughter of Demetrius I of Georgia
* Bek-Bars b. Muzaffar (c. 1173)
* Abd al-Malik IV b. Bek-Bars (c. 1180 – c. 1222)
* Rashid b. Farrukhzad (c. 1222 – c. 1225)
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.