The history of Chinese Americans or the history of ethnic Chinese in the United States relates to the three major waves of Chinese immigration to the United States with the first beginning in the 19th century. Chinese immigrants in the 19th century worked as laborers, particularly on the transcontinental railroad, such as the Central Pacific Railroad. They also worked as laborers in the mining industry, and suffered racial discrimination at every level of society. While industrial employers were eager to get this new and cheap labor, the ordinary white public was stirred to anger by the presence of this "yellow peril.” Despite the provisions for equal treatment of Chinese immigrants in the 1868 Burlingame Treaty, political and labor organizations rallied against the immigration of what they regarded as a degraded race and "cheap Chinese labor.” Newspapers condemned the policies of employers, and even church leaders denounced the entrance of these aliens into what was regarded as a land for whites only. So hostile was the opposition that in 1882 the United States Congress eventually passed the Chinese Exclusion Act, which prohibited immigration from China for the next ten years. This law was then extended by the Geary Act in 1892. The Chinese Exclusion Act is seen by some as the only U.S. law ever to prevent immigration and naturalization on the basis of race. These laws not only prevented new immigration but also brought additional suffering as they prevented the reunion of the families of thousands of Chinese men already living in the United States (that is, men who had left China without their wives and children); anti-miscegenation laws in many Western states prohibited the Chinese men from marrying white women.
In 1924 the law barred further entries of Chinese; those already in the United States had been ineligible for citizenship since the previous year. Also by 1924, all Asian immigrants (except people from the Philippines, which had been annexed by the United States in 1898) were utterly excluded by law, denied citizenship and naturalization, and prevented from owning land. In many Western states, Asian immigrants are even prevented from marrying Caucasians. 
Only since the 1940s when the United States and China became allies during World War II, did the situation for Chinese Americans begin to improve, as restrictions on entry into the country, naturalization and mixed marriage were lessened. In 1943, Chinese immigration to the United States was once again permitted—by way of the Magnuson Act—thereby repealing 61 years of official racial discrimination against the Chinese. Large-scale Chinese immigration did not occur until 1965 when the Immigration and Nationality Act of 1965 lifted national origin quotas. After World War II, anti-Asian prejudice began to decrease, and Chinese immigrants, along with other Asians (such as Japanese, Koreans, Indians and Vietnamese), have adapted and advanced. Currently, the Chinese constitute the largest ethnic group of Asian Americans (about 22%), and have confounded earlier expectations that they would form an indigestible mass in American society. For example, many Chinese Americans of American birth may know little or nothing about traditional Chinese culture, just as European Americans and African Americans may know little or nothing about the original cultures of their ancestors.