The Japanese occupation ends with the Japanese surrender in the autumn of 1945. The struggle for power between Chiang Kai-shek's Nationalists and Mao Zedong's Communists evolves into a full-scale civil war. By this time Chiang's army and government have lost most credibility. The communists gain massive support in the countryside, where they introduce their land reform policy. After years of heavy fighting the Red Army is able to encircle and capture the large cities. They take Beijing in January 1949. Chiang and the remnants of his government and troops flee to Taiwan, where he establishes a 'government in exile', which he leads for the next 25 years under a system of martial law.