When the Chinese attempted to prohibit the opium trade, the British declared war. The Opium War lasted three years (1839–1842) and graphically demonstrated the superiority of British firepower and military tactics to those of the Chinese. China sued for peace and, in the Treaty of Nanjing, agreed to open five coastal ports to British trade, limit tariffs on imported British goods, grant extraterritorial rights to British citizens in China, and pay a substantial indemnity to cover the British costs of the war. Beijing also agreed to cede the island of Hong Kong (dismissed by a senior British official as a “barren rock”) to Great Britain. Nothing was said in the treaty about the opium trade. Although the Opium War has traditionally been considered the beginning of modern Chinese history, it is unlikely that many Chinese at the time would have seen it that way. This was not the first time that a ruling dynasty had been forced to make concessions to foreigners, and the opening of five coastal ports to the British hardly constituted a serious threat to the security of the empire. Although a few concerned Chinese argued that the court should learn more about European civilization to find the secret of British success, others contended that China had nothing to learn from the barbarians and that borrowing foreign ways would undercut the purity of Confucian civilization. The Manchus attempted to deal with the problem in the traditional way of playing the foreigners off against each other. Concessions granted to the British were offered to other Western nations, including the United States, and soon thriving foreign concession areas were operating in treaty ports along the southern Chinese coast from Canton in the south to Shanghai, a bustling new port on a tributary of the Yangtze, in the center. In the meantime, the Qing court’s failure to deal with pressing internal economic problems led to a major peasant revolt that shook the foundations of the empire. On the surface, the so-called Taiping Rebellion owed something to the Western incursion; the leader of the uprising, Hong Xiuquan, a failed examination candidate, was a Christian convert who viewed himself as a younger brother of Jesus Christ and hoped to establish what he referred to as a “Heavenly Kingdom of Supreme Peace” in China. Its ranks swelled by impoverished peasants and other discontented elements throughout the southern provinces, the Taiping Rebellion swept northward, seizing the Yangtze River port of Nanjing in March 1853. The revolt continued for ten more years but gradually lost momentum, and in 1864, the Qing, though weakened, retook Nanjing and destroyed the remnants of the rebel force. One reason for the dynasty’s failure to deal effectively with internal unrest was its continuing difficulties with the Western imperialists. In 1856, the British and the French, still smarting from trade restrictions and limitations on their missionary activities, launched a new series of attacks against China and seized the capital of Beijing in 1860. In the ensuing Treaty of Tianjin, the Qing agreed to humiliating new concessions: legalization of the opium trade, the opening of additional ports to foreign trade, and cession of the peninsula of Kowloon (opposite the island of Hong Kong) to the British.