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.
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.
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 when Akhsitan I defeated emir Bek-Bars b. Muzaffar with his cousin George III (<abbr>r.</abbr>âÂÂ1156âÂÂ1184), the king of Georgia. In 901 AD (288 AH), the Emirate faced a large-scale Khazar raid. Emir Muhammad bin Hashim al-Sulami successfully defended the city, relying on the Banu Sulaym tribal garrison which formed the backbone of the Emirate's military power.
The Derbent emirate was mainly ruled by Hashimids, at times interrupted by Shirvanshah appointees:
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:
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.