During the last years of the Yuan dynasty, Jiangnan was fought for by two major rebel states: Zhu Yuanzhang's Ming faction, based in Nanjing, and the Suzhou-centered Wu faction led by Zhang Shicheng. A ten-year rivalry ended with Zhu's capture of Suzhou in 1367; having thus reunified Jiangnan, Zhu proclaimed himself the first emperor of the Ming dynasty on Chinese New Year's Day (20 January) of 1368, and a few months later expelled the Mongols from Northern China as well. Nanjing remained the capital of the Ming dynasty until the early 15th century, when the third Ming ruler, the Yongle Emperor, moved the capital to Beijing.