History of Sino-Korean relations
The history of Sino-Korean relations dates back to prehistoric times, which has been marked by both periods of cooperation and antagonism. The Han dynasty conquered Gojoseon in the 2nd century and the established of the Four Commanderies of Han in the northern portion of the Korean Peninsula. The Korean kingdom of Goguryeo aided Sima Yi of Cao Wei led a successful campaign against his rival Gongsun Yuan. The alliance later broke down, starting the Goguryeo–Wei War, which ended in Cao Wei victory. Later, taking advantage of Wei weakness, Goguryeo eventually reconquered the former territories of Gojoseon. The Sui dynasty launched four unsuccessful campaigns in the 7th century to subdue Goguryeo; Sui's defeats in Korea contributed to the collapse of the dynasty. Goguryeo fought further wars with the Tang dynasty, which allied with the Korean kingdom of Silla. Tang and Silla eventually prevailed over Goguryeo, leading Tang to establish the Protectorate General to Pacify the East. Unified Silla and Tang fought a war subsequently, in which Silla prevailed. Silla fell to Goryeo in 935.
The Khitan-led Liao dynasty of China fought a war with Goryeo, in which Goryeo prevailed, gaining parts of the northern Korean peninsula from Liao in exchange for submitting tribute. The Song regarded Goryeo as a potential military ally and maintained friendly relations as equal partners. In 1115 the Jurchen founded the Jin dynasty, and in 1125 Jin annihilated Liao and started invasion of Song, leading Goryeo to declare itself to be a tributary state of Jin in 1126. During the 13th century, the Mongol Empire invaded China and defeated the Jin and Song dynasties; the Mongol-led Yuan dynasty invaded Korea from 1231 to 1259, with the Yuan prevailing. After Yuan rule began to destabilize, King Gongmin of Goryeo seized the opportunity to rebel and declared Goryeo's independence. Following the fall of the Yuan and the emergence of the Ming dynasty in 1368, a proposed attack against the Ming resulted in a coup d'état led by General Yi Sŏnggye that ended the Goryeo dynasty and the establishment of the Joseon; Ming gave up competing territorial claims while Joseon accepted tributary status.
The Ming had assisted Joseon during Toyotomi Hideyoshi's invasion of Korea, in which the Wanli Emperor sent a total of 221,500 troops. Joseon had also used Classical Chinese as a common script alongside Korean, and its central government was modelled after the Chinese system. The Later Jin dynasty and its successor Qing dynasty, which replaced the Ming, invaded Joseon twice, in 1627 and 1636, forcing Injo of Joseon into submission. Following the First Sino-Japanese War. the Qing dynasty lost tributary relations with Korea diplomatic relations between the Qing dynasty and the Korean Empire were established in 1899, but relations were halted in 1905 as a result of the Eulsa Treaty that made Korea a Japanese protectorate and which was then annexed by the Japan in 1910. Later, the Chinese government recognized the formation of the Provisional Government of the Republic of Korea in 1919. Following Japan's surrender, Korea was split into North Korea and South Korea. Bilateral diplomatic relations between South Korea and the Republic of China were established in 1948, making the ROC the first country to recognize the Republic of Korea as the sole legitimate government of Korea. The People's Republic of China, established in 1949, recognized only the Democratic People's Republic of Korea during the Cold War, and backed the country against South Korea during the Korean War. In the 1980s, relations between the PRC and South Korea warmed, and the two countries established diplomatic relations in 1992.