The Chinese Presbyterian Mission Church became the first U.S. church with an Asian congregation when it opened its doors in San Francisco’s Chinatown in 1853. Six years later, it founded the first school in the nation to admit Chinese students.

But that landmark event did not inaugurate an enlightened educational policy toward the Chinese in San Francisco. Instead, it was a feeble exception to a long, ugly government policy of racist segregation that prevented Chinese students and other minorities from attending school with white children — and, for 14 years, prevented Chinese students from attending school at all.

The first Chinese arrived in San Francisco around 1848. For the next several years, they were few in number and were treated reasonably well: In 1850, Mayor John Geary invited the “China boys” to march in a funeral procession for President Zachary Taylor. A judge speaking at a ceremony in Portsmouth Square said, “You stand among us in all respects as equals.”

But that brief period of goodwill soon faded. As the Chinese population swelled in the 1850s, white San Franciscans increasingly turned against the immigrants. Like most white Americans at that time, they regarded all people of color, whether “Mongolians” (a common term for Asians), blacks, Indians or Latinos, as inferior races.

During San Francisco’s first years, the question of educating the Chinese did not arise. “Race was not mentioned in the early school laws of California.” Victor Low notes in “The Unimpressible Race: A Century of Educational Struggle by the Chinese in San Francisco.”

In an 1858 editorial, the San Francisco Evening Bulletin reflected the city’s overwhelming rejection of integrated schools. “Let us keep our public schools free from the intrusion of the inferior races,” the paper opined. “If we are compelled to have Negroes and Chinamen among us, it is better, of course, that they should be educated. But teach them separately from our Caucasian blood pure. We want no mongrel race of moral and mental hybrids to people the mountains and valleys of California.”

In 1859, 30 Chinese parents petitioned the San Francisco Board of Education to open a primary school for their children. When the Rev. William Speer offered a basement room in his Chinese Presbyterian Mission Church on Stockton Street between Clay and Washington, the board agreed to open the Chinese School.

It lasted just four months and closed for supposed lack of funds, although the total cost of operating it was only its teacher’s $75 monthly salary. For the next decade, the school was reopened several times, and each time soon shut down.

The school board routinely pointed to the school’s poor attendance as a reason to end the “doubtful experiment”: Attendance was indeed low, but a big reason for that was the school’s heavy emphasis on religion, which put off students.

Meanwhile, California’s third schools superintendent, a Southern racist named Andrew Jackson Moulder, ensured that the state’s schools would be strictly segregated for decades. In 1858, Moulder blasted “mock philanthropists for forcing Africans, Chinese and Diggers (Indians) into our white schools.”

In 1860, Moulder’s beliefs became law, when the Legislature decreed that “Negroes, Mongolians and Indians shall not be allowed into public schools” and authorized local officials to penalize any school that allowed “inferior races” to mix with whites. There was no requirement that public schools be provided for the Chinese or any other nonwhite children.

In 1864, a more progressive schools superintendent, John Swett, revised the state school law to require the establishment of separate schools for Chinese under certain circumstances, but the new law had little practical effect.

In 1869, the Chinese School moved from Stockton Street one block west to Powell Street. Because Stockton Street at that time was considered the border of Chinatown, this move exposed the school’s students to so-called “rude boys,” juvenile delinquents who insulted and attacked them. Attendance dropped further.

In the 1870s, as cheap Chinese labor undercut white workers’ wages, hostility to the Chinese peaked. In 1870, the state school law was changed again, stipulating that only blacks and Indians need be educated in separate schools. The San Francisco superintendent of schools, James Denman, who had closed the Chinese School a decade earlier, now had the legal right to close it for good.

Denman did so on March 1, 1871, citing its average daily attendance of just 20 students. For the next 14 years, there would be no public school for Chinese in San Francisco.

They were denied even separate schools like those accorded to blacks and Indians, who were granted that right in 1874.

The Chinese community argued that it was grossly unfair that they had to pay taxes and yet were denied the right to send their children to public schools. In 1878, 1,300 people of Chinese descent petitioned the Legislature, arguing that the 3,000 Chinese children in the state had the right to a public education. They were supported by some clergymen, like the Rev. William Gibson, whose position so enraged anti-Chinese mobs that he was hanged in effigy twice and had the windows of his Washington Street residence smashed.

But the state took no action, and the San Francisco Board of Supervisors remained adamant. “Guard well the doors of our public schools, that they do not enter,” read one of their reports. “For however hard and stern such a doctrine may sound, it is but the enforcement of the law of self-preservation, the inculcation of the doctrine of true humanity, and an integral part of the enforcement of the iron rule of right by which we hope presently to prove that we can justly and practically defend ourselves from this invasion of Mongol barbarianism.”

It took an 8-year-old girl named Mamie Tape to force the city and state to provide schools, albeit segregated ones, for Chinese. That story will be the subject of the next Portals.

Gary Kamiya is the author of the best-selling book “Cool Gray City of Love: 49 Views of San Francisco,” awarded the Northern California Book Award in creative nonfiction. All the material in Portals of the Past is original for The San Francisco Chronicle. Email: metro@sfchronicle.com

Trivia time

Previous trivia question: What was San Francisco’s first fern bar?

Answer: Henry Africa’s, which opened in 1969.

This week’s trivia question: Why was California’s first Legislature (1849-50) called “the legislature of a thousand drinks”?

Editor’s note

Every corner in San Francisco has an astonishing story to tell. Gary Kamiya’s Portals of the Past tells those lost stories, using a specific location to illuminate San Francisco’s extraordinary history — from the days when giant mammoths wandered through what is now North Beach to the Gold Rush delirium, the dot-com madness and beyond. His column appears every other Saturday, alternating with Peter Hartlaub’s OurSF.