In 1868 the United States and China established diplomatic relations under the terms of the Burlingame Treaty. That treaty encouraged immigration from China.The first significant numbers of Chinese had arrived in the United States during the California Gold Rush. In the initial days of the rush anyone was welcome. As gold became harder to find the Chinese in the gold fields the Chinese were resented. It did not take long for them to be pushed out of the gold fields. They were forced to take low paying jobs in the cities like San Francisco. The building of the TransContinental Railroad increased the demand for Chinese labor.
After the Panic of 1872 and the depression that followed the demand for labor decrease. With jobs scarce anti Chinese sentiments began to grow. Labor leader Denis Kearney and California governor John Bigler blamed the Chinese for depressed labor prices. An anti Chinese organization developed the Supreme Order of Caucasians which had 60 chapters in California. Tensions grew and California tried to exclude Chinese immigrants but there attempt was found unconstitutional under the California constitution.
In 1875 the Page Act of 1875 prohibited the immigration of women who were thought to be engaged in prostitution. In 1878 the Congress passed the first Chinese Exclusion Act but it was vetoed by President Hayes. In 1879 California passed a new constitution that gave it the right to exclude specific groups from the state. In 1882 the Congress passed a new Chinese Exclusion Act and it was signed into law by President Chester Arthur.
The act excluded Chinese laborers both skilled and unskilled laborers from entering Congress. It also required Chinese leaving the country to receive special permits to return. In 1884 the law was amended to clarify that it refers to any ethnic Chinese regardless of their country of origin. The Supreme court in the case of Che Chan Ping v United States the Supreme Court affirmed the constitutionality of the law.