The treaties imposed on China in the 1840s allowed foreigners to do business in the "treaty ports," as the cities opened to foreign commerce were called. The treaties, as the foreigners interpreted them, allowed foreign settlements to grow up which were effectively outside Chinese jurisdiction. The treaties gave foreigners immunity from most Chinese taxes and allowed foreign troops to be stationed in China. They allowed missionaries to propagate Christianity freely. And the treaties gave foreigners the right of extraterritoriality, remaining subject to the laws of their own country rather than the laws of China, and it was this right that lay at the center of foreign privilege in China. (paraphased from Clifford's Spoilt Children of Empire)

There was continual friction between foreigners and the Chinese with the foreigners refusing to recognise the authority of the local law courts in matters involving themselves.

The Treaty of Nanking in 1842 hinted at British subjects being under the jurisdiction only of the local British consul, but the terms of Extra-territoriality, under which foreigners were completely exempt from Chinese control were fully clarified in a treaty between the China and the United States in 1844:

"Subjects of China who may be guilty of any criminal act towards citizens of the United States shall be arrested and punished by the Chinese authorities according to the laws of China, and citizens of the United States who may commit any crime in China shall be subject to be tried and punished only by the Consul or other public functionary of the United States thereto authorised according to the laws of the United States; and in order to secure the prevention of all controversy and disaffection, justice shall be equitably and impartially administered on both sides."

Under the "most favoured nation" clause in the treaties all western countries signed with China, the rights obtained by any one country could automatically be claimed by all the others. Extra-territoriality included.