To an extent, the Arab–Khazar wars were also linked to the long-lasting struggle of the Caliphate against the Byzantine Empire along the eastern fringes of Anatolia, a theatre of war which adjoined the Caucasus. The Byzantine emperors pursued close relations with the Khazars, which amounted to a virtual alliance for most of the period in question, including such exceptional acts as the marriage of emperor Justinian II () to a Khazar princess in 705. The possibility of the Khazars linking up with the Byzantines through Armenia was a grave threat to the Caliphate, especially given its proximity to the Umayyad Caliphate's metropolitan province of Syria. This did not materialize, and Armenia was left largely quiet, with the Umayyads granting it wide-ranging autonomy and the Byzantines likewise refraining from active campaigning there. Indeed, given the common threat posed by the Khazar raids, the Umayyads found the Armenians (and the neighbouring Georgians) willing allies against the Khazars.