From the late 1340s onwards, people in the countryside suffered from frequent natural disasters such as droughts, floods and the resulting famines, and the government's lack of effective policy led to a loss of popular support. In 1351, the Red Turban Rebellion started and grew into a nationwide uprising. In 1354, when Toghtogha led a large army to crush the Red Turban rebels, Toghun Temür suddenly dismissed him for fear of betrayal. This resulted in Toghun Temür's restoration of power on the one hand and a rapid weakening of the central government on the other. He had no choice but to rely on local warlords' military power, and gradually lost his interest in politics and ceased to intervene in political struggles. He fled north to Shangdu from Dadu (present-day Beijing) in 1368 after the approach of the forces of the Míng Dynasty (1368–1644), founded by Zhu Yuanzhang in the south. He had tried to regain Dadu, which eventually failed; he died in Yingchang (located in present-day Inner Mongolia) two years later (1370). Yingchang was seized by the Ming shortly after his death. Some royal family members still lived in Henan today.
The Prince of Liang, Basalawarmi established a separate pocket of resistance to the Ming in Yunnan and Guizhou, but his forces were decisively defeated by the Ming in 1381. By 1388 the remaining Yuan forces in Manchuria under Nahacu had also surrendered to the Ming Dynasty.
Northern Yuan
The Yuan remnants retreated to Mongolia after the fall of Yingchang to the Ming in 1370, where the name Great Yuan was formally carried on, and is known as the Northern Yuan . According to Chinese political orthodoxy, there could be only one legitimate dynasty whose rulers were blessed by Heaven to rule as Emperor of China (see Mandate of Heaven), and so the Ming and the Northern Yuan denied each other's legitimacy as emperors of China, although the Ming did consider the previous Yuan which it had succeeded to be a legitimate dynasty. Historians generally regard Míng Dynasty rulers as the legitimate emperors of China after the Yuan Dynasty, though Northern Yuan rulers also claimed to rule over China, and continued to resist the Ming under the name "Yuan" or "Northern Yuan".
The Ming army pursued the Northern Yuan forces into Mongolia in 1372, but were defeated by the latter under Ayushridar and his general Köke Temür. They tried again in 1380, ultimately winning a decisive victory over Northern Yuan in 1388. Many Mongols were taken prisoner, and Karakorum (the Northern Yuan capital) was sacked in 1380. Eight years later, the Northern Yuan throne was taken over by Yesüder, a descendant of Ariq Böke, instead of the descendants of Kublai Khan. The following centuries saw a succession of Genghisid rulers, many of whom were mere figureheads put on the throne by those warlords who happened to be the most powerful. Periods of conflict with the Ming Dynasty intermingled with periods of peaceful relations with border trade. In 1402, Örüg Temür Khan (Guilichi) abolished the name Great Yuan; he was however defeated by Öljei Temür Khan (Bunyashiri), protege of Tamerlane (Timur Barulas) in 1403. A few decades later the new khan Batumongke (1464–1517/43) took the title Dayan meaning "Da Yuan" or "Great Yuan". and reunited the Mongols. His successors continued to rule until the submission to the Qing Dynasty, ending the Northern Yuan in 1635.