During the Arab–Khazar wars of the 7th and 8th centuries, the kings of Sarir allied themselves with the Khazars. Following the victorious campaign of Merwan ibn Muhammad in 737–739, Sarir was pressed into submitting to the Caliph's authority. It paid tribute and provided men for the Arab garrison of Derbent until the ninth century, when, emboldened by the shift in momentum in the south, Sarir asserted sovereignty over large portions of the Caucasus, including Gumik, Filan and parts of Arran.