The Han Chinese and Mongols have been in contact with each other for millennia. Throughout history, Mongolia and China have had complicated relations. The Great Wall was constructed to ward off the northern nomads attacks, from the Xiongnu during the Qin Dynasty, the Turks during the Tang Dynasty, and later, the Mongolians and Central Asians. In 1271, Mongols under Kublai Khan, grandson of Genghis Khan, established the Yuan Dynasty and conquered all of China in 1279. In 1368, the Chinese under the Ming Dynasty successfully expelled the Mongols from China and in 1388, sacked the Northern Yuan's capital at Karakorum. The Ming Great Wall was strengthened and the period was characterized by repeated Mongol raids into China and Chinese raids into Mongolia. During the Qing conquest of the Ming, the Mongol leader Ligdan Khan allied with the Ming against the Qing until Ligdan was defeated by Qing forces and Inner Mongolia was conquered by the Qing. In 1644, the Ming Dynasty was overthrown by peasant rebels under Li Zicheng, who established the short lived Shun Dynasty which would soon be replaced by the Qing Dynasty. During the Qing rule from 1691, Inner and Outer Mongolia were incorporated into the empire. After the fall of the Qing dynasty in 1911, the Republic of China was established and Mongolia declared its independence after more than 200 years of Qing dynasty rule. During this period, the Beiyang government as the successor to the Qing claimed Mongolia as Chinese territory, but lacked any stable control over the region due to massive civil wars in the south and the rise of regional warlords in the Warlord Era. Consequently, Outer Mongolia sought Russian support to claim its independence. In 1919, Chinese general Xu Shuzheng advanced into Outer Mongolia and annulled its independence. In 1921, Chinese forces were driven out by White Russian forces led by Baron Roman von Ungern-Sternberg. Some months later they were driven out by the Red Army of the Russian Soviet Federative Socialist Republic, the Far Eastern Republic and pro-Soviet Mongolian forces. In 1924, the Mongolian People's Republic was proclaimed. With the onset of the Japanese invasion of China, little effort was given to reestablish Chinese control over Outer Mongolia. Following the end of World War II, the Republic of China, led by the Kuomintang, was forced to formally accept Outer Mongolian independence under Soviet pressure. In 1949, the Communists won the Chinese Civil War and re-recognized Mongolia's independent status.
Communist era
The People's Republic of China established diplomatic relations with Mongolia on October 16, 1949 and both nations signed a border treaty in 1962. With the Sino-Soviet split, Mongolia aligned itself with the Soviet Union and asked for the deployment of Soviet forces, leading to security concerns in China. As a result, bilateral ties remained tense until 1984, when a high-level Chinese delegation visited Mongolia and both nations began to survey and demarcate their borders. In 1986, a series of agreements to bolster trade and establish transport and air links was signed. In 1988, both nations signed a treaty on border control. Mongolia also began asserting a more independent policy and pursued more friendly ties with China. Mongolia has always been suspicious that China wants to claim Mongolian territory, and concerned by fears of China's overpopulation pouring into Mongolian territory.
Modern period
In the Post-Cold War era, China has taken major steps to normalize its relationship with Mongolia, emphasizing its respect for Mongolia's sovereignty and independence. In 1994, Chinese PremierLi Peng signed a treaty of friendship and cooperation. China has become Mongolia's biggest trade partner and source of foreign investment. Bilateral trade reached US$1.13 billion by the first nine months of 2007, registering an increase of 90% from 2006. China offered to allow the use of its Tianjin port to give Mongolia and its goods access to trade within the Asia Pacific region. China also expanded its investments in Mongolia's mining industries, giving it access to the country's natural resources. Mongolia is also a participant in the Belt and Road Initiative. China is likely to support Mongolia's membership in to the Asia Cooperation Dialogue, Asia-Pacific Economic Cooperation and granting it observer status in the Shanghai Cooperation Organization.