In 744 the Uyghur Khaganate (744–840) was formed as a confederation of nine Uyghur clans. The Tang allied with the Uyghur Bayanchur Khan to suppress the An Lushan rebellion, An Lushan himself being from Soghdian-Turkish descend. For their aid, the Tang sent 20,000 rolls of silk and bestowed them with honorary titles. In addition the horse trade was fixed at 40 rolls of silk for every horse and Uyghurs were given "guest" status while staying in Tang China. While the Tang thereafter lost their military power in the Tarim, the Uyghurs pressed for control of the eastern basin and Gansu.