Chinese first began settling Taiwan in the early 1600s, and in 1683 the Qing put Chinese colonists and indigenous Taiwanese under two distinct kinds of administration. The Qing conquered Xinjiang , to the west, in 1759, the culmination of a long-running struggle with the Zunghar Mongols for dominance in Central Asia. The imperial court ran Xinjiang under loose military rule, allowing indigenous elites to manage local affairs. Chinese settlers followed, colonizing parts of northern Xinjiang. Tibet, too, fell under Qing control during the Zunghar wars, thanks to a combination of military intervention and religious diplomacy. The Tibetan lamas and Qing emperors agreed in principle to split spiritual and secular realms of authority between them, in a formula known as the “priest-patron relationship.”

Hong Kong is a different case, but it is also linked to the Qing imperial era and, perhaps surprisingly, to Xinjiang. The city was ceded by the Qing to Britain in the 1842 Treaty of Nanking that ended the first Opium War — the same treaty that opened treaty ports elsewhere on the Chinese coast to western commerce. This infamous agreement, widely known as an “unequal treaty,” is unquestionably a case of British imperialist aggression. But the idea of letting foreigners manage frontier trade enclaves like Hong Kong and the other treaty ports was a standard element of the Qing imperial repertoire. Indeed, Russians had traded in just such an enclave in Kiakhta, in Qing Mongolia, since 1727.

Before the first Opium War, the Qing faced a challenge off Xinjiang’s western border similar to the one they later faced from the British. Merchants from the Khanate of Kokand attacked Kashgar repeatedly to press for trade privileges. After years of instability, the Qing and Kokand reached a deal to open a trade enclave, let Kokandi officials apply their own laws and levy customs tariffs in return for governing the Kashgar marketplace, and granted most-favored-nation status to merchants from other lands. Many of the same Qing officials who negotiated the Treaty of Kokand in 1835 subsequently dealt with the British, and key articles of the treaties that settled the first Opium War in the 1840s mirrored those in the Kokand agreement. Trade enclaves may have been a foreign imposition, but they were also a tool of the Qing state.

When the C.C.P. first came to power in 1949, it tacitly recognized this imperial past. Like the Soviet Union — another socialist state that denounced Western imperialism while itself assuming power in a former empire — the P.R.C. did not want to look like an evil colonialist. So it acknowledged the ethnic diversity of the peoples living in the territory it controlled by recognizing 55 nationalities besides the majority Han. And it established titular “autonomous” administrations in non-majority-Han areas, in many of the same places where the Qing had ruled through local non-Han elites, including Xinjiang and Tibet.

The special economic zones that Deng Xiaoping established in the late 1970s in Shenzhen and other Chinese cities revived a Qing precedent. Those zones look a lot like the traditional trade enclaves in Kiakhta, Kashgar, Hong Kong and the treaty ports. And like the Qing trade enclaves, they facilitate commerce by granting legal and tax privileges to foreign businesses. Similarly, the promise of “One Country, Two Systems” — the principle that is supposed to guarantee Hong Kong a high degree of autonomy and serve, Beijing hopes, as a model for the future reunification of Taiwan with the mainland — is another echo of Qing policy.