During the Second Sino-Japanese War and World War II, the U.S. provided economic and military assistance to the Chiang Kai-shek government against the Japanese invasion. In particular, the "China Hands" (American diplomats known for their knowledge of China) also attempted to establish diplomatic contacts with Mao Zedong's communist regime in their stronghold in Yan'an, with a goal of fostering unity between the Nationalists and Communists. However, relations soured after communist victory in the Chinese Civil War and the relocation of the Chiang government to Taiwan, together with the start of the Cold War and rise of McCarthyism in U.S. politics. The newly communist China and the U.S. fought a major undeclared war in Korea, 1950–53 and, as a result, President Harry S. Truman began advocating a policy of containment and sent the United States Seventh Fleet to deter a possible communist invasion of Taiwan. The U.S. signed the Sino-American Mutual Defense Treaty with Taiwan which lasted until 1979 and, during this period, the communist government in Beijing was not diplomatically recognized by the U.S. By 1950, virtually all American diplomatic staff had left mainland China, and one of Mao's political goals was to identify and destroy factions inside China that might be favorable to capitalism.