only a few months. Tarmashirin (1326–1334) converted to Islam and raided the Delhi Sultanate, reaching as far as Delhi. Tarmashirin was brought down by an anti-Muslim rebellion of the eastern tribes. A son of Duwa, Changshi, was enthroned in 1335. One of his sons was baptized. Pope Benedict XII appointed the Franciscan Richard of Burgundy to Almalik in 1339 but he was killed by Muslims in the Ili region. Giovanni de' Marignolli, a papal legate, arrived in the Ili valley the following year on his way to the Yuan dynasty. He built a church and baptized some people during his stay but the presence of Christianity did not last much longer after his departure. Transition to Moghulistan (1338–1363) The khanate became increasingly unstable in the following years and split in two during the 1340s. Transoxania was ruled by Qazan Khan ibn Yasaur. In 1346 a tribal chief, Amir Qazaghan, killed Qazan and set up Danishmendji as puppet khan. Danishmendji was killed a year later and replaced with Bayan Qulï. Qazaghan made Herat a tributary in 1351. He was assassinated in 1357 and was succeeded by his son Abdullah, who killed Bayan Qulï in 1358. This aroused the anger of local lords such as Hajji Beg, the uncle of Tamerlane. Hajji drove out Abdullah to the Hindu Kush, where he died. From then on the Chagatayid khans of Transoxania served as nothing more but figureheads until it was annexed by the Timurid Empire. In the east, the powerful Dughlats enthroned a son of Esen Buqa I, Tughlugh Timur as khan of Moghulistan in 1347. In 1350, Tughlugh converted to Islam. In 1360, Tughlugh invaded Transoxania and conquered it. Hajji Beg fled in the face of overwhelming power. The future conqueror Timur entered Tughlugh's service and was appointed ruler of Shahr-i Sebz. After Tughlugh left Transoxania, Hajji Beg returned in force, only to be driven away again by Tughlugh. Hajji Beg was killed near Sebzewar. As a result, Timur came to power. Tughlugh expanded his territory into Afghanistan by defeating Amir Husayn. Thus the Chagatai Khanate was restored under Tughlugh. Following his death in 1363, Timur and Amir Husayn took over Transoxiana. Timur and Amir Husayn forced Tughlugh's successor Ilyas Khoja out of Transoxania, and then Timur eliminated Amir Husayn as well, gaining mastery over Transoxiana (1369–1405). Like his predecessors, Timur maintained a puppet khan on the throne to legitimize his rule,