During World War II, because of a growing Japanese threat over the Mongolian-Manchurian border, the Soviet Union reversed the course of Mongolian socialism in favor of a new policy of economic gradualism and build-up of the national defense. The Soviet and Mongolian armies defeated Japanese forces that had invaded eastern Mongolia in the summer of 1939 at the Battle of Khalkhin Gol, and a truce was signed setting up a commission to define the Mongolian-Manchurian border in the autumn of that year.
After 1941, Mongolia's economy was readjusted to support the Soviet Union in every way possible, including providing funding for several Soviet military units. In the summer of 1945, the Soviet Union used Mongolia as one base for launching Manchurian Strategic Offensive Operation, a successful attack against the Japanese. The preceding build-up brought 1.5 million Soviet soldiers to Mongolia, along with massive amounts of equipment. The Mongolian Army played a limited support role in the conflict, but her involvement gave Stalin the means to force the Chinese side to finally accept Mongolia's independence.
The February 1945 Yalta Conference provided for the Soviet Union's participation in the Pacific War. One of the Soviet conditions for its participation, put forward at Yalta, was that after the war Outer Mongolia would retain its "status-quo." The precise meaning of this "status-quo" became a bone of contention at Sino-Soviet talks in Moscow in the summer of 1945 between Stalin and Jiang Jieshi's representative T.V. Soong.
Stalin insisted on Republic of China's recognition of Outer Mongolia's independence - something that it already enjoyed de facto even as it remained a part of China de jure. Jiang Jieshi resisted the idea but eventually gave in. However, Jiang extracted from Stalin a promise to refrain from supporting the Chinese Communist Party, partly as a quid pro quo for giving up Outer Mongolia.
Thus, the Sino-Soviet Treaty guaranteed Outer Mongolia's independence. But it also ended Khorloogiin Choibalsan's hopes for uniting Outer Monoglia with Inner Mongolia, which remained in China's hands. Choibalsan initially hoped that Stalin would support his vision of Great Mongolia but the Soviet leader easily sacrificed Choibalsan's vision for Soviet gains, guaranteed by the Sino-Soviet Treaty and legitimized by the Yalta agreements. In this sense, the Sino-Soviet Treaty marked Mongolia's permanent division into independent Mongolian People's Republic and neighboring Inner Mongolia.
Secure in its relations with Moscow, the Mongolian Government shifted to postwar development, focusing on civilian enterprise. International ties were expanded, and Mongolia established relations with North Korea and the new Communist states in Eastern Europe. Mongolia and the People's Republic of China (PRC) recognized each other in 1949, and PRC renounced all territorial pretensions towards Outer Mongolia. However, Mao Zedong privately hoped for Mongolia's reintegration with China. He raised this question before the Soviet leadership as early as 1949 (in meeting with Anastas Mikoyan at Xibaipo), and then, having been firmly rebuffed by Stalin, in 1954, after Stalin's death. In 1956, following Nikita Khrushchev's denunciation of Stalin, the Chinese leaders attempted to present Mongolia's independence as one of Stalin's mistakes in meetings with Mikoyan. The Soviet's response was that the Mongols were free to decide their own fate.
In the 1950s relations between the MPR and the PRC improved considerably. China provided much needed economic aid, building up entire industries in Ulaanbaatar, as well as apartment blocks (for example, the so called "120 myangat district"). Thousands of Chinese laborers were involved in these projects until China withdrew them after 1962 in a bid to pressure Mongolia to break with Moscow at the time of worsening Sino-Soviet relations.
Mongolia took a sharply pro-Soviet stand in the Sino-Soviet dispute, being one of the first socialist countries to endorse the Soviet position in the quarrel with China. Military build-up on the Sino-Mongolian border began as early as 1963; in December 1965 the Mongolian Politburo requested the Soviet Union to station its military forces in Mongolia. In January 1966, with Leonid Brezhnev's visit to Mongolia, the two countries signed a mutual assistance treaty, paving way to Soviet military presence in the MPR. In February 1967, following weeks of worsening Sino-Soviet tensions, Moscow officially approved the stationing of what became the 39th Soviet army in Mongolia.
With Soviet encouragement, Mongolia increased its participation in communist-sponsored conferences and international organizations. In 1955, Mongolia attempted to join the United Nations, but the request was vetoed by Republic of China (ROC), which maintained their (renewed) claim over Mongolia. Mongolia became a member of the UN in 1961 after the Soviet Union threatened to veto the admission of all of the newly decolonized states of Africa unless the ROC would not use its veto. Diplomatic relations with the United States were not established until the end of the Cold War.
After Mikhail Gorbachev came to power in the Soviet Union, he implemented the policies of perestroika and glasnost. The atmosphere of reform in the Soviet Union prompted similar reforms in Mongolia. Following mass demonstrations in the winter of 1990, the MPRP began to loosen its controls of the political system. The Politburo of the MPRP resigned in March, and in May the constitution was amended, deleting reference to the MPRP's role as the guiding force in the country, legalizing opposition parties, creating a standing legislative body, and establishing the office of president. On July 29, 1990, the first free, multiparty elections in Mongolia were held. The election results returned a majority for the MPRP, which won with 85% of the vote. It was not until 1996 that the reformed MPRP was voted out of office.
The USSR withdrew its troops stationed in Mongolia, and its technical and financial assistance, between 1987 and 1992.Subsequently, the foreign and defense policy of Mongolia profoundly changed: “Maintaining friendly relations with the Russian Federation and the People’s Republic of China shall be a priority of Mongolia’s foreign policy activity. It shall not adopt the line of either country but shall maintain in principle a balanced relationship with both of them and shall promote all-round good neighborly co-operation.