Chinese immigrants first came to California in large numbers for the gold rush, and they stayed to build the transcontinental railroad, reclaim farmland, and work in factories and laundries. They met organized hostility from the start: miners' taxes aimed at foreigners, testimony barred in court, segregated schools in San Francisco, and periodic mob violence. After the railroad's completion, economic depression fed the scapegoating. Denis Kearney's Workingmen's Party rallied San Francisco sandlots under the cry The Chinese Must Go, and a mob sacked the city's Chinatown in 1877.
In 1882 Congress passed the Chinese Exclusion Act, suspending the immigration of Chinese laborers for ten years and barring Chinese residents from citizenship. It was the first major American law to exclude a nationality by name. The Geary Act of 1892 renewed exclusion and required Chinese residents to carry certificates of residence on pain of deportation; in 1902 exclusion was made indefinite, and in 1917 Congress added an Asiatic Barred Zone covering most of Asia. On the Pacific coast, the Angel Island station, opened in 1910, detained arriving Chinese for weeks or months of interrogation. The Immigration Act of 1924 folded Asian exclusion into the new national-origins quota system.
Chinese Americans fought back through the courts and their own institutions. In Yick Wo v. Hopkins (1886) the Supreme Court struck down San Francisco's discriminatory laundry licensing as a violation of equal protection. In United States v. Wong Kim Ark (1898) the Court confirmed that children born in the United States to Chinese parents were birthright citizens under the Fourteenth Amendment. Community associations, the Chinese Consolidated Benevolent Association above all, funded lawsuits and defended residents, and after the 1906 San Francisco earthquake destroyed the city's records, thousands established citizenship claims through the paper sons system.
The exclusion era was written in blood as well as law: white miners murdered twenty-eight Chinese coal miners at Rock Springs, Wyoming, in 1885, and Chinese communities were expelled from Tacoma and Seattle in 1885-1886. Exclusion split families for generations, since wives generally could not join laborer husbands, and it established the template for the racialized immigration restrictions that followed.