European influence. Until the 1830s, they seemed almost invulnerable to European attack. By 1840 that old immunity was dead in the case of China and dying in Japan. Instead, both states came under growing pressure from the Europeans. Britain, Russia and the United States took the lead. They demanded free access to the ports of East Asia, freedom to trade with Chinese and Japanese merchants, and an end to the diplomatic protocols under which Westerners had the status of barbarians, culturally and politically inferior to the Middle Kingdom and Japan. They accompanied these demands by the demonstration and use of military force, and by territorial demands - coastal and modest (though far from trivial) by the maritime British, much larger by continental Russia. Not surprisingly, this traumatic alteration in their international position had far-reaching political, cultural and economic consequences in China and Japan. By 1880, both had undergone a series of internal changes that were revealingly described by their makers as 'restorations': the T'ung-chih ('Union for Order') restoration in China, the Meiji ('Enlightened rule') restoration in Japan.72 Both were the result of the convergence of internal stresses and external threat. But, as we shall see, their trajectories were very different, and so was the scale of the transformation they promised. China was the first to feel the weight of European displeasure. The occasion was the breakdown of the old 'Canton system' for China's trade with Europe. Under this system, Canton was the only port through which the trade - confined to a closely regulated guild of Chinese merchants (the 'Hong') - was lawful. Europeans (who were allowed to maintain warehouses - 'factories' - on the quay) were forbidden to live permanently in the city, departing for Macao at the close of the trading season. The end of the East India Company monopoly of British trade in 1833, and the rapid increase in the number of 'free' British merchants selling opium - almost the only commodity that the Chinese would accept for their tea, apart from silver - brought on a crisis. When the Chinese authorities, alarmed by the flood of opium imports and the outflow of silver (the basis of China's currency) to pay for them, as well as by the widespread flouting of the rule that all foreign commerce must pass through Canton, tried to reimpose control, driving away the British official sent to supervise the trade and confiscating contraband opium, the uproar in London led to military action. In February 1841 the Royal Navy arrived off Canton, the Chinese war fleet was destroyed, and an invading force landed in the city. When the Chinese prevaricated, a second force entered the Yangtze delta, occupied Shanghai, smashed a Manchu army, and closed the river and the Grand Canal (the main artery of China's internal trade). By August 1842 the British had arrived at Nanking, the southern capital of the empire, and prepared to attack it. The emperor capitulated, and the first of the 'unequal treaties' was signed.73 Under the 1842 Treaty of Nanking, five 'treaty ports' were opened to Western trade, Hong Kong island was ceded to the British, the Europeans were allowed to station consuls in the open ports, and the old Canton system was replaced by the freedom to trade and the promise that no more than 5 per cent duty would be charged on foreign imports. It was a staggering reversal of the old terms on which China had dealt with the West. But its significance (at this stage) should not be overstated. Irksome as the treaty was to the Chinese authorities, it had certain merits. The foreigners were kept well away from Peking, could not travel freely, and, under the system of consular jurisdiction, would be carefully segregated administratively from the Chinese population.74 To a great inland, agrarian empire, the snapping of barbarians on the distant coast was a nuisance to be neutralized by skilful diplomacy. But the treaty was not the end of the matter. It was followed by continual friction between Chinese and Europeans. By 1854 the British were pressing hard for its revision, to open more ports and allow Europeans to move freely into the interior and widen the scope of their trade. In 1856, the ' Arrow ' incident, when the Chinese seized a ship allegedly flying the British flag, became the excuse for a second round of military coercion. When the Chinese stalled the implementation of a new treaty agreed in 1858, an Anglo-French expedition arrived at Tientsin and marched on Peking, burning the emperor's summer palace in revenge for their losses. The second great treaty settlement, the Convention of Peking, threw open many more ports, as far north as Tientsin and far up the Yangtze, and gave Europeans (including missionaries) the right to roam in the Chinese interior. Moreover, the old fiction of Chinese diplomatic superiority was to be firmly scotched by forcing the emperor to permit European diplomats to be stationed in Peking. China, it seemed, had been forcibly integrated into the Europeans' international system, on humiliating terms and as a second-rate power, at best. To the more thoughtful of Chinese administrators and scholars (and Chinese officialdom was recruited from the ablest classical scholars), these startling events required explanation. Their conclusions were uncompromising. Their methods had failed: urgent reform was needed. Better ways had to be found to deal with the barbarians. Western knowledge would have to be systematically translated and disseminated. Transport and communications must be improved. Above all, China must acquire the modern weapons needed to prevent the ability of the West to attack the vital points of the empire almost at will. 'We are shamefully humiliated by [Russia, America, France and England],' complained the scholar reformer Feng Kuei-fen (1809-74), 'not because our climate, soil, or resources are inferior to theirs, but because our people are really inferior... Why are they [the Westerners] small and yet strong? Why are we large and yet weak?'75 But, by the time that Feng wrote, the empire was beset by an internal crisis that seemed far more dangerous than the spasmodic coercion inflicted by the Europeans. In the 1850s and '60s, huge areas of central and southern China, some of its richest and most productive regions, were in the grip of rebellion, paralysing trade, cutting off the imperial revenue, and portending the withdrawal of the 'mandate of heaven': the source of dynastic legitimacy. Much the most serious of these great upheavals was the Taiping Rebellion. It began in South West China with the visions of a millenarian prophet, whose preaching combined elements of Christian teaching picked up from the missionaries with the bitter outcry of peasantry oppressed by economic misfortune. Hung Hsiu-ch'uan declared himself the younger brother of Jesus Christ, and in 1851 proclaimed a new dynasty, the Taiping T'ien-kuo, or Heavenly King dom of Great Peace, with himself as Heavenly King. With astonishing speed, his movement gathered recruits into a peasant army, picked off the isolated garrisons of the Ch'ing government, and swept into the empire's Yangtze heartland. By early 1853 it had captured Nanking. Hung's aim, however, was to replace the dynasty. By 1855 his troops had reached Tientsin and seemed poised to capture the ultimate prize, the imperial capital. This was the high tide. From there his army was forced gradually back to the Yangtze valley, but its eventual defeat was delayed until 1864, with the death of Hung and the fall of Nanking to imperial troops.76 The Taiping Rebellion, the great Nien Rebellion that spread across a vast region north of the Yangtze and lasted until 1868,77 and the Muslim revolt in the west (1862-73) were symptomatic of a drastic breakdown in the political, social and economic order. This may have had its roots in the plight of the agrarian economy, which was battered by a series of misfortunes after 1830. China had achieved a remarkable growth in agricultural production in the eighteenth century. The clearing of new land, and the more intensive farming of old, had kept food supplies well abreast of a surging population that had reached c. 430million by 1850. Commercialization and the rise of internal trade enabled farmers to increase their output by specialization and exchange. Increasing supplies of silver (as foreign trade expanded) lubricated this prosperous pre-industrial economy with a stream of money.78 But well before 1850 these sources of economic expansion had dried up. The inflow of silver was replaced by a massive outflow, as opium imports soared:79 perhaps up to half of the silver accumulated since 1700 was lost in a few years after 1820.80 The sharp contraction of money supply forced down prices and dried up commerce. The supply of new land could no longer meet the pressure of population. The struggle to extract even more food from old lands reached its limit and may have triggered an ecological backlash, with deforestation, soil erosion, the silting of rivers and declining fertility. In north-central China, the shift in the course of the Yellow River in 1855 was an environmental disaster on a massive scale. With these multiple setbacks came rising social tension: between tax-collectors and payers; between landlords and tenants; between locals and newcomers in regions where earlier prosperity had drawn in people from elsewhere; between ethnic and religious minorities and the Han majority, who had poured into the western lands in the colonization movement of the previous century. The state officials, who struggled to keep order, collect the land revenue, maintain the waterways and manage the grain reserves, faced increasing resistance from a discontented population. Their authority and prestige had already been undermined by the 'privatizations' in the era of commercial expansion as licensed merchants took more control over tax-collecting, water conservancy and the grain tribute system - a change that was readily equated with the growth of bureaucratic corruption. It was no accident that the Taiping programme demanded more land for the peasants, and the return to a more frugal and self-sufficient age. Nor that it denounced the use of opium - a stance that ensured the furious hostility of Western merchants and their governments. By 1860, then, the scholar-gentry officials who governed the Ch'ing Empire faced disaster. Their prestige and self-confidence were being hammered by the demands of the British, French, Americans and Russians (who had wrung the vast Amur basin out of Peking in the Treaty of Aigun in 1858). Their domestic authority, and the revenue base that sustained the whole superstructure of imperial rule, were imploding as rebellion spread across the eighteen provinces of China proper as well as the outer provinces. In these desperate conditions, their achievements were remarkable. New generals like Tseng Kuo-fan (1811-72) and Li Hung-chang (1823-1901) contained, squeezed and eventually suffocated the great rebellions. They raised new-style armies in the provinces, equipped with Western weapons. They mobilized the provincial gentry, who officered these new regional forces. They levied new taxes on commerce and foreign trade (through the Western-managed Maritime Customs Service). As the rebellions petered out, Tseng and Li looked for ways to 'self-strengthen' China. They encouraged the import of scientific knowledge. Two great arsenals were built to produce modern weapons. Chinese merchants were encouraged with subsidies and monopolies to invest in modern enterprises, especially shipping and mining. There was even an abortive attempt to buy a modern navy in the West, complete with European officers. These 'modernizing' efforts were accompanied in rural China by the drive to resettle land devastated by the rebellions, repair the waterways, and restore the authority of the gentry officials.81 What this great effort could not achieve (and was not meant to achieve) was the transformation of China into a modern state on the Western model. The limits of Tseng's and Li's 'self-strengthening' were humiliatingly revealed in August 1884, when French warships blew China's new (but wooden-hulled) fleet to pieces in a quarrel over Vietnam.82 Though state-merchant cooperation might have found ways of promoting industrial enterprise, this was a far cry from industrializing the economy more generally. The mid-century combination of agrarian crisis and political upheaval made the task even harder. There was no prospect, for example, of building a new China round the core of its most prosperous region in the Yangtze delta, the heart of its eighteenth-century commercial economy. It had been badly damaged in the Taiping Rebellion, and was too vulnerable to Western penetration to serve this purpose. It might even be argued that the real priority of the 'restoration' was precisely that: to restore the authority of the Confucian state and its ethos of frugality and social discipline, not to break the Confucian mould.83 But if industrial transformation had eluded the scholar-gentry reformers, the importance of their state-building should not be underestimated. Of necessity, the mid-century reforms had devolved considerable power on the provinces and provincial gentry. The recovery programme in the countryside helped to revive the unwritten compact between the peasant and his scholar-gentry rulers. But the gentry were also bound more tightly to the empire by the progressive displacement of the high Manchu officials by ethnic Chinese: with a more unified elite, China was gradually becoming more completely a Chinese state - although recent research suggests that Manchu predominance remained a bone of contention.84 China might not have been able to match the industrial output or modern firepower of the European states, but her cultural and social solidarity had been strengthened just in time for the crisis years after 1890. Nor in the meantime had the European states been able to turn the Middle Kingdom into a mere semi-colonial periphery. The treaty ports had been meant as bridgeheads into the Chinese economy, opening it up Indian-style to Western manufactures. But, though foreign trade expanded (to the considerable benefit of the rural economy), Chinese merchants resisted the entry of foreign business into the domestic economy. Foreigners were forced to deal with their Chinese customers through a middleman, the comprador.85 In a fiercely competitive and uncertain market, there were few easy pickings. The turnover was rapid. By the 1870s, all but two of the largest foreign merchants, Jardine Matheson and Butterfield Swire, had gone to the wall, or made way for new entrants.86 Compared with India, China (with twice the population) was a far smaller and more difficult market, consuming only half the level of India's imports. When a crash came in the early 1880s, the commercial eldorado the Europeans had imagined seemed to have vanished almost completely.87 But the real test of China's political and economic independence was yet to come. In the 1850s and '60s there was every reason to think that Japan would suffer the fate of China, in an even more drastic form. Since the early 1800s the gradual opening of the North Pacific had brought more and more shipping to the seas round Japan, from Russia (whose 'Wild East' lay only a few hundred miles to the north), Britain and the United States. In 1853 the Japanese shogun had nervously welcomed the American Commodore Perry, accepting that the era of sakok u (seclusion) was over. Five years later, in the 'unequal treaties' of 1858, the main Western powers were granted similar privileges of access to those they had extorted from China in 1842. Foreigners would be free to come and trade in a number of 'treaty ports' (the most important was Yokohama, near Tokyo), where they would remain under the protection of their consuls and be exempt from Japanese jurisdiction. Here land would be set aside for their offices, warehouses and residences. Japan would not be allowed to levy customs duties except at a modest rate, to encourage 'free trade' and the diffusion of Western manufactures. With its old isolation once broken, Japan seemed far more vulnerable to Western domination than its vast continental neighbour on the Asian mainland. Its population (c. 32 million) was much smaller, though far from negligible in European terms. Its main cities were desperately exposed to Western sea power (Japan had no navy). Russians had invaded Sakhalin (their first landing was in 1806) and