In 1397 Edigu allied himself with Timur-Qutlugh and was appointed General and commander-in-chief of the Golden Horde armies. In 1399 he inflicted a crushing defeat on Tokhtamysh and Vytautas of Lithuania at the Vorskla River. Thereupon he managed to unite under his rule all Jochi's lands, albeit for the last time in history.