Khazars shadowed Maslama's march south and attacked him near Derbent, but the Arab army, augmented by local levies, resisted their onslaught until a small picked force attacked the "khagan"s tent and wounded the Khazar ruler himself. Taking heart, the Muslims attacked and defeated the Khazars. It is probably this battle or campaign in which Barjik was reportedly killed. Taking advantage of his victory, Maslama evicted the Khazars from Derbent by poisoning their water supply and re-founded the city as a military colony, garrisoning it with 24,000 mostly Syrian troops divided into quarters by the districts ("jund") of their origin. After that he returned with the rest of his army (mostly the favoured Jaziran and Qinnasrini contingents) south of the Caucasus for the winter, while the Khazars re-occupied their abandoned towns. Despite the capture of Derbent, Maslama's record was apparently unsatisfactory for Hisham, who replaced his brother in March 732 with Marwan ibn Muhammad, who would later reign as the last Umayyad caliph in 744–750.