In 1918, he joined the Nationalist Party of Sun Yat-sen. Sun Yat-sen helped Jiang Kai-Shek make a military academic school called Huangpu Military School. In 1926 and 1927 he led the Northern Expedition to conquer local warlords and unify China. After Sun Yat-sen died, he pushed out the Communists in 1927. In 1928, he made a new government in Nanjing, and became head of the state. He focused on fighting the Communists and the Empire of Japan. In 1937, Japan began to invade China, and Chiang was in charge of the Nationalist Chinese Army, until the war ended in 1945. Chiang ruled China until 1949, when Mao Zedong, who led the Communist Party of China, attacked Chiang and his officials, and they were forced to flee to Taiwan.