The United States has always taken pride in being a democratic haven for the oppressed, a place where persecuted minorities like Jews could begin life anew. But for centuries, American society was racist to the core. A case in point is The Chinese Exclusion Act, signed by President Chester A. Arthur on May 6, 1882. Under its draconian terms, laborers from China were barred from American shores, Chinese born in the United States were denied citizenship and Chinese people who went abroad on a trip were not allowed back.

This nasty piece of legislation remains unique in the annals of America, the only one which singled out an ethnic or religious group for such mistreatment. Astonishingly enough, it remained in force for 61 years, a stain on the fabric of American democracy.

How it came to be enacted is recounted in The Chinese Exclusion Act, a first-rate documentary by Ric Burns and Li-Shin Yu scheduled to be broadcast by the PBS network on May 29 at 8 p.m. (check local listings). An amalgam of vintage photographs, file footage and interviews with historians and researchers, the nearly two-hour-long film examines a period when white supremacy, xenophobia, racism and antisemitism were all too common and acceptable.

The first Chinese immigrants to reach the United States arrived in California in the mid-19th century, hoping to strike it rich during the Gold Rush. Four thousand trickled in during the first wave, followed by a further 14,000 who settled in San Francisco and environs.

At first, they were tolerated as hard-working immigrants. But in the gold fields, where competition was fierce, the Chinese were regarded as interlopers, and racial strife broke out. The newly-elected governor of the state, John Bigler, a bigot, fanned the flames of anti-Chinese sentiment. His objective was to rid California of Chinese.

During the U.S. Civil War, President Abraham Lincoln encouraged Chinese immigration and increased trade with China. The Pacific Railway Act of 1862 prompted 30,000 Chinese men to come to America to build a railroad from the east coast to the west coast. American exclusionists railed against the influx.

Once the railroad was built, Chinese workers spread throughout the west. With the passage in 1869 of the 14th Amendment, which granted citizenship to all American-born residents, Chinese newcomers headed to towns and cities in the northeast. By 1870, the United States was home to 64,000 Chinese, who were generally regarded as an alien and unassimilable minority. More to the point, white American workers of European origin feared that Chinese “coolies” would steal their jobs and leave them destitute.

Inevitably, anti-Chinese feeling erupted into violence. In 1871, race riots in Los Angeles ravaged Chinatown and claimed the lives of 15 Chinese in lynchings. During the 1880s, Chinese people were driven out of, among other places, Eureka, California, and Tacoma, Washington.

Anti-Chinese ordinances popped up all over the country. With the passage of the Page Act in 1875, Chinese women, portrayed as prostitutes, were effectively prohibited from joining their husbands in the United States. Democrats and Republicans were both in agreement on the need to keep Chinese immigration levels to a bare minimum. In 1879, Congress passed the Fifteen Passenger bill, which allowed harbormasters to turn away ships carrying more than 15 Chinese passengers. The Chinese Exclusion Act was replaced by the Geary Act in 1892.

Such was the intolerant social climate of the day that virtually every Chinese person was forced to live  in this or that Chinatown. The campaign to segregate the Chinese coincided with the Jim Crow era, which humiliated and disenfranchised African Americans, and the placement of native American Indians on reservations.

In the face of these indignities, Chinese Americans fought back, launching 10,000 lawsuits in the quest for justice. In 1898, the U.S. Supreme Court upheld the 14th Amendment. Yet the battle was far from won. In 1917, immigration laws were tightened, in part, to keep out Chinese immigrants.

With the Japanese invasion of China in the 1930s, the pendulum of American public opinion swung behind the Chinese. Japan’s attack on Pearl Harbor on December 7, 1941 solidified that trend. On December 17, 1943, President Franklin Roosevelt repealed many of the discriminatory anti-Chinese laws. It was an important opening, a huge victory for Chinese.

The Hart-Celler Act in 1965 removed racist provisions in the immigration law, encouraging Asians to flood into the United States at unprecedented rates. But popular attitudes took longer to change. Chinese were still seen as “the other.”

It seems hard to believe today that Chinese Americans, like Jews, were once the object of such scorn, condescension, stereotypes and hatred. But more than 130 years after the passage of the Chinese Exclusion Act, times have indeed changed in America.