In the 50s and 60s of the 14th century, there were small states in Mavarannahr under feudal fragmentation. Amir Timur participated in the wars between these states and became famous among the barlas in the valleys of Kashgadarya.
In 1360, Tughluq-Teymur, the ruler of the state called Mogholistan, which was formed in the territory of Kazakhstan, attacked the Kashkade valley. In 1361, he attacked and wanted to occupy this place 11 times. Tughluq-Teymur, wary of Teymur, recognized him as the ruler of the Kashgadarya valley and returned. Using the time to his favor, Timur made an alliance with another judge named Amir Hussein. In 1361-1365, they often raided neighboring provinces and returned with loot. In 1362, Amir Timur and Amir Huseyn fell into the hands of the Turkmen emir Ali Bey during the next visit. But they paid a lot of money and were saved. In 1365, Amir Timur and Amir Hussein were defeated in a battle with the troops of Ilyas Khoja, who replaced Tughluq Timur, and retreated to Balkh province. Although Ilyas Khoja besieged Samarkand, he was defeated by the army led by the madrasah student Mavlanzadeh.