Relations between Afghanistan and China have been mostly friendly throughout history, with trade relations between these regions date back to at least the Han dynasty with the profitable Silk Road. Presently, both countries have embassies in Beijing and Kabul respectively, and the two countries share a narrow international border.

Since the establishment of the modern nation of Afghanistan (1709), relations have been variously positive or tense, but in recent history have been more friendly including during most of the 20th century, with China extending economic aid and multi-million dollar loans to develop Afghanistan during the early Cold War period. This friendship was briefly interrupted after the Sino-Soviet split and the Soviet invasion of Afghanistan (1979), with the USSR installing pro-Soviet and anti-Chinese regimes in Afghanistan. However, since the withdrawal of Soviet troops and détente of Soviet and subsequent Russian-Chinese relations, China-Afghan relations have also improved significantly in the 21st century.

Afghanistan–China relations

Since the United States invasion initiating the War in Afghanistan, Chinese political involvement initially has been somewhat limited, but trade relations have still been continuing with China as Afghanistan's largest trading partner and China giving Afghanistan millions of dollars in aid throughout the war. China's influence and shuttle diplomatic role in Afghanistan has also been growing over the years, and China could help broker peace in the war-torn country. After the Taliban regained control of the country in 2021, China, like all other countries as of , does not recognize the reinstated Islamic Emirate. Despite its non-recognition, China negotiates issues of trade, investment, and aid with the Taliban government.

Afghanistan–China relations

History (Han to Qing) Various Chinese dynasties have also occupied parts of Afghanistan and Central Asia around their current border; and Afghanistan has historically been at the center of the lucrative Silk Road.

Afghanistan–China relations

Han dynasty

The Han defeated the Dayuan in the Han-Dayuan war, thereby establishing Chinese control over parts of northern Afghanistan. Later the Han dynasty set up the Protectorate of the Western Regions to protect Silk Road trade through Central Asia. In antiquity, the region that is now Afghanistan was known for its devotion to Buddhism, which had been founded in India in the 5th century BC. Chinese records from the Han dynasty refer to Kabul as "Kao-fu", which is described as a wealthy cite located in the Hindu Kush mountains on a strategic location on the trade routes linking Central Asia to India. A Buddhist monk from what is now Afghanistan arrived in China in 2 BC and converted the first Chinese to Buddhism. Afghanistan was often visited by Chinese Buddhist pilgrims on their way to India in antiquity, and Buddhist sites such as Balkh and the Buddhas of Bamyan attracted many Chinese visitors. Chinese records credit craftsmen from Afghanistan with producing the first glass in China between 424 and 428 AD, through archaeological evidence suggests that glass was being produced earlier in China.

Tang dynasty

In 605, emissaries from what is now Afghanistan arrived in Luoyang (at the time China's capital) to pay tribute to the Emperor in exchange for greater rights to trade with China. When the Tang dynasty was established in 618 AD, the claim to see Afghanistan as part of China's sphere of influence was inherited, a claim that successive Tang emperors were willing to enforce via military means.

During the Tang dynasty parts of Afghanistan were under the control of China's Protectorate General to Pacify the West. In 659, Soghd and Ferghana, along with cities like Tashkent, Samarkand, Balkh, Herat, and Kabul, became part of the protectorate under Emperor Gaozong. Afghanistan's Herat and Uzbekistan's Bukhara and Samarkand became part of the Tang protectorate. The Indian historian K. P. S. Menon wrote about the Chinese "performed the remarkable feat of sending an army of 100,000 men which marched up the Pamirs from Kashgar" and then crossed Afghanistan to occupy the Hunza Valley in what is now Pakistan under Tang General Gao Xianzhi.

The defeat of the Western Turks and the defeat of the Sassanids by the Arabs had facilitated the Chinese expansion under Emperor Gaozong into Herat, northeastern Iran and Afghanistan (Tukharistan), Bukhara, Samarkand, Tashkent, and Soghdiana, which previously belonged to the western Turks.