Threatened with thirst, the Arab army left Baykand and headed for Bukhara, with Qatan in the vanguard. When the Türgesh and Soghdian forces attacked, the vanguard, some 6,000 men, was cut off from the main body under Ashras, and Ashras and Qatan gave each other up for lost until they met again two days later. The king of Samarkand, Ghurak, who had unto this moment remained ostensibly loyal to the Arabs—although, ever careful to hedge his bets, he had sent his son Mukhtar to the khagan—now switched sides.