Toghon Temür (; Mongolian script: ; ; 25 May 1320 – 23 May 1370), also known by his temple name as the Emperor Huizong of Yuan () bestowed by the Northern Yuan dynasty and by his posthumous name as the Emperor Shun of Yuan () bestowed by the Ming dynasty, was the last emperor of the Yuan dynasty and later the first emperor of the Northern Yuan dynasty. Apart from Emperor of China, he is also considered the last Khagan of the Mongol Empire. He was a son of Kusala (Emperor Mingzong). During the last years of his reign, the Yuan dynasty was overthrown by the Red Turban Rebellion, which established the Ming dynasty, although the Yuan court under his rule remained in control of northern China and the Mongolian Plateau. The remnant Yuan regime is known as the Northern Yuan in historiography. Emperor Huizong was a Buddhist student of the Karmapas (heads of the Karma Kagyu school of Tibetan Buddhism) and is considered a previous incarnation of the Tai Situpas. He also notably invited the Jonang savant Dölpopa Shérab Gyeltsen to teach him, but was rebuffed. Before succession Toghon Temür was born to Kuśala, known as Khutughtu Khan or Emperor Mingzong, when he was in exile in Central Asia. Toghon Temür's mother was Mailaiti, descendant of Arslan Khan, the chief of the Karluks. According to a folk legend, the former Chinese Southern Song Emperor Gong of Song, Zhao Xian, had an affair with Yuan Empress Mailaiti. Zhao Xian allegedly fathered Yuan Toghon Temür with Mailaiti as a bastard child. The Mongols circulated a similar story about the Yongle Emperor. Following the civil war known as the War of the Two Capitals that broke out after the death of Yesün Temür (Emperor Taiding) in 1328, Toghon Temür attended his father and entered Shangdu from Mongolia. However, after Kuśala died and his younger brother was restored to the throne as Jayaatu Khan Tugh Temür (Emperor Wenzong), he was kept from the court and was banished to Goryeo (modern Korea) and later to Guangxi in South China. While he was in exile, his stepmother Babusha was executed. When Emperor Wenzong died in 1332, his widow, Empress Dowager Budashiri respected his will to make the son of Kuśala's succeed to the throne instead of Wenzong's own son, El Tegüs. However, it was not Toghon Temür but his younger half-brother Rinchinbal, who was enthroned