 The Arab – Khazar wars were part of a long series of military conflicts between the nomadic peoples of the Pontic @-@ Caspian steppe and the more settled regions south of the Caucasus range , dating back to Antiquity . The two great passes over the Caucasus , the Darial Pass ( " Alan Gates " ) in the centre and the Pass of Derbent ( " Caspian Gates " ) had been used as invasion routes since Classical times , and their defence against the destructive raids of the steppe peoples came to be regarded as one of the chief duties of imperial regimes to the south . Thus the shahs of the Sassanid Empire , from Peroz I ( r . 457 – 484 ) to Khosrau I ( r . 531 – 579 ) , built a long line of fortifications from the Caucasus to the Caspian Sea . Derbent itself , which would feature prominently in the Arab – Khazar conflict , was built by the Persians in the early 6th century as a strategic choke @-@ point and gateway ( its name in Persian , Dar @-@ band , means " Knot of the Gates " ) between the north and south . This is reflected in the popular belief among Middle Eastern cultures that Alexander the Great had with divine assistance barred the Caucasus against the hordes of " Gog and Magog " , commonly regarded as an echo of the invasions by the Scythians and the Huns . Eventually , the Khazars would take their place , and early medieval writers came to identify the Khazars with Gog and Magog . 
