[4] This is reflected in the popular belief in ancient and medieval Middle Eastern cultures that Alexander the Great had barred the Caucasus with divine assistance against the mythical hordes of Gog and Magog.
According to historian Gerald Mako, the latter were stereotypical "northern barbarians" as conceived by the settled civilizations of Eurasia: "uncivilized savages who drank blood, who ate children, and whose greed and bestiality knew no limits".
[14][15] The collapse of the West Turkic khaganate led to the independence of the Khazars, then living in the Middle Volga region, and their emergence as an imperial power in their own right between the 660s and 680s, when they defeated Old Great Bulgaria and expanded into the North Caucasus.
[20] This was reflected in early Muslim geographic works, where the Caucasus was seen as part of a great continuous mountain chain that spanned the earth, and divided the civilized lands of the south from the 'Land of Darkness' beyond, an idea deriving from Persian and possibly ancient Babylonian traditions.
[23][a] While their Byzantine and Sasanian predecessors simply sought to contain the steppe peoples through fortifications and political alliances, historian David Wasserstein writes that the leaders of the Arab caliphate were "expansionists interested in conquest"; their northward thrust threatened the survival of the Khazars as an independent polity.
[24] Historian Khalid Yahya Blankinship agrees, emphasizing the highly ideological nature of the Muslim caliphate and its dedication to the doctrine of jihad, which in political terms entailed "the struggle to establish God's rule in the earth through a continuous military effort against the non-Muslims".
Kennedy stresses that this force was spread throughout the empire and many of the muqatila proved loath to answer summons if the prospects for an easy victory and plunder were low, but on the other hand, these numbers could be supplemented by unregistered Arab volunteers.
[42][43] The less-rigidly organized, semi-nomadic nature of the Khazar state also worked to their advantage against the Arabs, as they lacked a permanent administrative centre, whose loss would paralyze the government and force them to surrender.
Wasserstein objects to Obolensky's proposition as a scheme of extraordinary ambition which hinges on two untenable assumptions: that the Muslims had concluded that a direct assault against Byzantium was without prospects of success, and that they had more detailed geographical knowledge than can be demonstrated for the time in question.
Al-Tabari's History of the Prophets and Kings, written in the early 10th century, reports that Shahrbaraz, the Persian governor of Derbent, offered to surrender the fortress to the Arabs and aid them against the Caucasian peoples if he and his followers were relieved of the jizya, a poll tax imposed on non-Muslims.
[67][68] Disregarding the caliph's instructions for caution and restraint, Abd al-Rahman or (according to Baladhuri and Ya'qubi) his brother Salman[68] led a large army north in 652, aiming to take Balanjar.
A large-scale raid across the South Caucasus in 683 or 685 (also a time of civil war in the Muslim world) was more successful, capturing much booty and many prisoners and killing the presiding princes of Iberia (Adarnase II) and Armenia (Grigor I Mamikonian).
[78] According to the historian Thomas S. Noonan, on the other hand, the "cautious nature of Khazar policy in the Southern Caucasus" made them avoid direct confrontation with the Umayyads and intervene only during times of civil war.
[18][86][87] The eighth-century Armenian historian Łewond reports that Derbent was in the hands of the Huns at that time; the 16th-century chronicle Derbent-nameh says that it was defended by 3,000 Khazars, and Maslama captured it only after a resident showed him a secret underground passage.
Thirty thousand Khazars invaded Armenia that winter, and decisively defeated the mostly Syrian army of local governor[e] Ma'laq ibn Saffar al-Bahrani at Marj al-Hijara (Rocky Meadow) in February and March 722.
Despite his energy, Maslama's campaigns failed to produce the desired results; by 729, the Arabs had lost control of the northeastern parts of the South Caucasus and were again on the defensive, with al-Jarrah having to defend Adharbayjan against a Khazar invasion.
Ibn al-Athir reports that he reached the Khazar capital, al-Bayda on the lower Volga, but no other source mentions this; modern historians generally consider this improbable, possibly resulting from confusion with other events.
[139][142][143] Muslim sources record a number of other, heavily embellished attacks by Sa'id on improbably large Khazar armies; in one, Barjik was reportedly killed in single combat with the Umayyad general.
Sa'id was relieved of his command in early 731 by Maslama and imprisoned at Qabala and Bardha'a, charged with endangering the army by disobeying orders, and was released (and rewarded) only after the caliph intervened on his behalf.
[146][147][148] Noonan points out that the jealousies between the Arab commanders, and their rapid turnover, adversely impacted their war effort, as it "inhibited the development and execution of a long-term strategy for dealing with the Khazar problem".
[160][161] Marwan was more active in the south, appointing Ashot III Bagratuni as the presiding prince of Armenia; this effectively gave the country broad autonomy in exchange for the service of its soldiers in the Caliphate's armies.
He apparently went to Damascus to ask Hisham for support; the 10th-century historian Bal'ami says that his army numbered 150,000 men, including regular forces from Syria and the Jazira, jihad volunteers, Armenian troops under Ashot III, and armed camp followers and servants.
Thirty thousand men (including most of the levies from the Caucasian principalities) under Derbent governor Asid ibn Zafir al-Sulami advanced north along the Caspian coast, and Marwan crossed the Darial Pass with the bulk of his forces.
[174][175] This was a "spectacularly deep penetration", according to Blankinship, but of little strategic value; the 10th-century travellers Ibn Fadlan and Istakhri describe the Khazar capital as little more than a large encampment, and there is no evidence that it had been larger or more urbanized in the past.
Dunlop placed this as early as c. 740, but the process is not well documented and was apparently gradual; it was certainly underway in the last decades of the eighth century, according to historical sources, and numismatic evidence indicates that it was probably complete by the 830s.
[193] Many modern scholars believe that the Khazar elites' conversion to Judaism was a means of stressing their own identity as separate from (and avoiding assimilation by) the Christian Byzantine and Muslim Arab empires with which they were in contact and was a direct result of the 737 events.
[200] Dunlop on the other hand writes that Marwan came "within an ace of succeeding" in his conquest of Khazaria, and suggests that the Arab commander "apparently intended to resume operations against the khagan at a later date" which never materialized.
[208] Soviet and Russian archaeologists and historians such as Murad Magomedov [ru] and Svetlana Pletnyova consider the eighth-century emergence of the Saltovo-Mayaki culture in the steppe region between the Don and Dnieper Rivers as resulting from the Arab–Khazar conflict, since Alans from the North Caucasus were resettled there by the Khazars.
A completely different story is reported by al-Tabari; the Khazars were invited to attack by a local Arab magnate in retaliation for the execution of his father, the governor of Derbent, by the general Sa'id ibn Salm.
The final disintegration of the Abbasid empire during the early 10th century also led to the establishment of large Muslim principalities in the region, often ruled by non-native (Daylamite or Kurdish) dynasties, such as the Shirvanshahs, the Sallarids, and the Shaddadids, to name the most prominent.