structural:expansion, information:extraction, structural:summarization, information:classification, linguistic:voice_change
Rebellion, unrest, and external pressure

At the start of the dynasty, the Chinese empire continued to be the hegemonic power in East Asia. Although there was no formal ministry of foreign relations, the Lifan Yuan was responsible for relations with the Mongols and Tibetans in Inner Asia, while the tributary system, a loose set of institutions and customs taken over from the Ming, in theory governed relations with East and Southeast Asian countries. The Treaty of Nerchinsk, signed in 1689, stabilized relations with Tsarist Russia.

However, during the 18th century European empires gradually expanded across the world, as European states developed economies built on maritime trade, colonial extraction, and advances in technology. The dynasty was confronted with newly developing concepts of the international system and state-to-state relations. European trading posts expanded into territorial control in nearby India and on the islands that are now Indonesia. The Qing response, successful for a time, was to establish the Canton System in 1756, which restricted maritime trade to that city (present-day Guangzhou) and gave monopoly trading rights to private Chinese merchants. The British East India Company and the Dutch East India Company had long before been granted similar monopoly rights by their governments.

In 1793, the British East India Company, with the support of the British government, sent a diplomatic mission to China led by Lord George Macartney in order to open trade and put relations on a basis of equality. The imperial court viewed trade as of secondary interest, whereas the British saw maritime trade as the key to their economy. The Qianlong Emperor told Macartney "the kings of the myriad nations come by land and sea with all sorts of precious things", and "consequently there is nothing we lack..."

Since China had little demand for European goods, Europe paid in silver for Chinese goods, an imbalance that worried the mercantilist governments of Britain and France. The growing Chinese demand for opium provided the remedy. The British East India Company greatly expanded its production in Bengal. The Daoguang Emperor, concerned both over the outflow of silver and the damage that opium smoking was causing to his subjects, ordered Lin Zexu to end the opium trade. Lin confiscated the stocks of opium without compensation in 1839, leading Britain to send a military expedition the following year. The First Opium War revealed the outdated state of the Chinese military. The Qing navy, composed entirely of wooden sailing junks, was severely outclassed by the modern tactics and firepower of the British Royal Navy. British soldiers, using advanced muskets and artillery, easily outmaneuvered and outgunned Qing forces in ground battles. The Qing surrender in 1842 marked a decisive, humiliating blow. The Treaty of Nanjing, the first of the " unequal treaties ", demanded war reparations, forced China to open up the Treaty Ports of Canton, Amoy, Fuzhou, Ningbo and Shanghai to Western trade and missionaries, and to cede Hong Kong Island to Britain. It revealed weaknesses in the Qing government and provoked rebellions against the regime.

The Taiping Rebellion in the mid-19th century was the first major instance of anti-Manchu sentiment. The rebellion began under the leadership of Hong Xiuquan (1814–64), a disappointed civil service examination candidate who, influenced by Christian teachings, had a series of visions and believed himself to be the son of God, the younger brother of Jesus Christ, sent to reform China. A friend of Hong's, Feng Yunshan, utilized Hong's ideas to organize a new religious group, the God Worshippers' Society (Bai Shangdi Hui), which he formed among the impoverished peasants of Guangxi province. Amid widespread social unrest and worsening famine, the rebellion not only posed the most serious threat towards Qing rulers, it has also been called the "bloodiest civil war of all time"; during its fourteen-year course from 1850 to 1864 between 20 and 30 million people died. Hong Xiuquan, a failed civil service candidate, in 1851 launched an uprising in Guizhou province, and established the Taiping Heavenly Kingdom with Hong himself as king. Hong announced that he had visions of God and that he was the brother of Jesus Christ. Slavery, concubinage, arranged marriage, opium smoking, footbinding, judicial torture, and the worship of idols were all banned. However, success led to internal feuds, defections and corruption. In addition, British and French troops, equipped with modern weapons, had come to the assistance of the Qing imperial army. Nonetheless, it was not until 1864 that Qing armies under Zeng Guofan succeeded in crushing the revolt. After the outbreak of this rebellion, there were also revolts by the Muslims and Miao people of China against the Qing dynasty, most notably in the Miao Rebellion (1854–1873) in Guizhou, the Panthay Rebellion (1856–1873) in Yunnan and the Dungan Revolt (1862–1877) in the northwest.

The Western powers, largely unsatisfied with the Treaty of Nanjing, gave grudging support to the Qing government during the Taiping and Nian Rebellions. China's income fell sharply during the wars as vast areas of farmland were destroyed, millions of lives were lost, and countless armies were raised and equipped to fight the rebels. In 1854, Britain tried to re-negotiate the Treaty of Nanjing, inserting clauses allowing British commercial access to Chinese rivers and the creation of a permanent British embassy at Beijing.

In 1856, Qing authorities, in searching for a pirate, boarded a ship, the Arrow, which the British claimed had been flying the British flag, an incident which led to the Second Opium War. In 1858, facing no other options, the Xianfeng Emperor agreed to the Treaty of Tientsin, which contained clauses deeply insulting to the Chinese, such as a demand that all official Chinese documents be written in English and a proviso granting British warships unlimited access to all navigable Chinese rivers.

Ratification of the treaty in the following year led to a resumption of hostilities. In 1860, with Anglo-French forces marching on Beijing, the emperor and his court fled the capital for the imperial hunting lodge at Rehe. Once in Beijing, the Anglo-French forces looted and burned the Old Summer Palace and, in an act of revenge for the arrest, torture, and execution of the English diplomatic mission. Prince Gong, a younger half-brother of the emperor, who had been left as his brother's proxy in the capital, was forced to sign the Convention of Beijing. The humiliated emperor died the following year at Rehe.