Timur had no unambiguously appointed heir at the time of his death; as a result, a succession dispute erupted among his surviving sons and grandsons. Khalil Sultan proclaimed himself emperor at Tashkent soon after his grandfather's death and seized the royal treasury, as well as Timur's imperial capital Samarqand. Shah Rukh marched his army out of Herat to the Oxus river but made no offensive move against his nephew at this point. This was likely due to Miran Shah, Khalil Sultan's father, who posed a serious threat as he, along with his other son Abu Bakr, had led an army out of Azerbaijan in support of the younger prince. They were both forced to withdraw prior to joining with Khalil Sultan however, due to invasions to their rear by the Jalayirids and the Qara Qoyunlu, who took advantage of the death of the old emperor to seize territory. Miran Shah was killed in battle in 1408 whilst attempting to repel the invaders, with Abu Bakr dying similarly the year after.