When gold flowed from the California mines beginning in the late 1840's, immigrants from as far as Mexico, Chile, France, and China came to America hoping to strike it rich. The increased number of workers created a good deal of competition between American laborers and their foreign counterparts. As white miners began, in their eyes, to be crowded out, a cry of "California for Americans" rose up.

At the time, both major political parties were attempting to get a foothold in California and the American miners became viewed as a valuable voting bloc. Complaints about foreign miners were taken seriously and prompted politicians to act on behalf of their constituents. One of the earliest laws came in the form of the Foreign Miners License tax implemented in 1850.

This legislation required all non-native born workers to pay twenty dollars per month for the right to mine. Immigrants who had come to America but couldn't afford the license wound up destitute in cities such as San Francisco. Due to the influx of unemployed laborers moving to the towns, the bill was repealed and replaced by new legislation in 1852 that charged the more economical rate of three dollars a month.

Workers were not the only ones heading to California. Industries travelled across the country to expand their own markets. Many Chinese laborers left the mines and sought employment in other fields. One of the largest employers of the Chinese work force was the Central Pacific Railroad. A 1909 study on Chinese immigration notes:

A farther lease of life was undoubtedly given to the coolie error by the importation of several thousand Chinese laborers by the Pacific Railroads in 1868 and 1869. In order to complete the roads in the time required by Congress, a very large force of laborers was needed; since very few white men were to be had at any price the Central Pacific sent an agent to China, who engaged several thousand Chinamen there and prepaid their passages and other expenses. Each Chinaman signed a promissory note for $75 in gold coin, payable on demand, secured by the endorsement of friends in China and agreed to repay it in regular installments for seven months, from a guaranteed wage of $35 per month. Every laborer was free to go home as soon as his debt was paid.

Tensions between ethnic groups often rose and fell with the fluctuating economy. Competition for jobs increased when the railroad was completed and 10,000 men (9,000 of which were Chinese) were released. Then, in 1873 the Eastern Panic prompted a number of Americans to emigrate West in search of a better way of life. Racial conflict came to a head in July, 1877 when whites specifically targeted Chinese laborers during a three-day riot in San Francisco.

With racial violence on the rise and increasing complaints about the unfair treatment of white laborers, politicians sought to address the perceived threat of Chinese laborers (who, not surprisingly, were not citizens and therefore, did not have any political clout). The solution arrived at was to exclude these foreign laborers from coming to America in the first place.