but once in power, the Kuomintang orchestrated a violent mass purge of Communists, referred to as the Shanghai Massacre. In 1937, the Kuomintang and the communists formed a new alliance to oppose the Japanese invasion of China, but they resumed fighting each other in 1942. After Japan had been defeated in 1945, both Chinese factions signed a truce, but the Chinese Civil War soon erupted again between them. In 1949, with Soviet support, the communists won the Chinese Civil War and established the People's Republic of China, which made an alliance with the Soviets. Mao became the first leader of Communist China. Mao's most radical supporters, who became known as the "Gang of Four," gradually eliminated most of his rivals throughout his 27 years in power. Ideological tension between the two countries emerged after Stalin's death in 1953. Nikita Khrushchev denounced Stalin's crimes in 1956, and both regimes started to criticise each other. At first, the criticism was indirect and muted, but in 1961, Mao accused the Soviet leadership of revisionism, and the alliance openly ended. Both countries competed for control over foreign communist states and political movements, and many countries had two rival communist parties that concentrated their fire on each other. In 1969, a brief border war between the two countries occurred. Khrushchev had been replaced by Leonid Brezhnev in 1964, who abandoned many Soviet reforms criticized by Mao. However, China's anti-Soviet rhetoric intensified under the influence of Mao's closest supporters, the Gang of Four. Mao died in 1976, and the Gang of Four lost power in 1978. After a period of instability, Deng Xiaoping became the new leader of China. The philosophical difference between both countries lessened somewhat since China's new leadership abandoned anti-revisionism. China's internal reforms did not bring an immediate end to conflict with the Soviet Union. In 1979, China invaded Vietnam, which was a Soviet ally. China also sent aid to the mujahedin against the Soviet invasion of Afghanistan. In 1982, Brezhnev made a speech offering reconciliation with China, and Deng agreed to restore diplomatic relations. In 1985, Mikhail Gorbachev became General Secretary of the Communist Party of the Soviet Union, reduced the Soviet garrisons at the Sino–Soviet border and in Mongolia, resumed trade, and dropped the border issue that had caused open war 16 years earlier. In 1989, he withdrew Soviet support from the communist government of Afghanistan. Rapprochement accelerated after the Soviet