Wong Chut King knew that to live in San Francisco was to remain in the shadows. At the age of 41, he had passed the majority of the last two decades of his life in dank, dark rooms, spending as little as he could to ensure his survival. Whatever money he did manage to keep from his job at a rat-infested lumberyard on Pacific Street he sent back to his wife and parents in his native village of Bei Keng, a tiny hamlet located in the southwest corner of China’s Guangdong province.

He had arrived in California—known in his native Cantonese as Gum Shan, or the Gold Mountain—in the mid-1880s, most likely having been recruited from his village by a labor broker who covered the cost of the long trip across the Pacific to Canada. Once there, he made his way across the unguarded border and headed south toward San Francisco. He traveled by foot and wagon along the coast, unnerved by the towering redwoods—taller than any structure he had ever seen—rising above him, and felt the chill of the Pacific seep into his bones as he lay alone at night, trying to remember the warm, humid air flowing off the rivers at home.

He expected a hard life once he reached the city, and he soon found it. The first known Chinese immigrants had reached California during the frenzy of the Gold Rush in 1849, and within five years there were forty thousand Chinese living in the state. The influx of newcomers, with foreign habits and their foreign tongues, prompted lawmakers in some of the first sessions of California’s new state legislature to pass a series of discriminatory acts targeting Asians. The Chinese Exclusion Act—the first major federal law to restrict immigration into the United States— passed in 1882, prompted by fears among white Americans that Chinese labor was pushing wages down. Ten years later, California congressman Thomas Geary introduced the Geary Act, which when passed extended the Chinese Exclusion Act by ten years and required Chinese residents to carry a certificate of residence with them at all times under penalty of deportation or a year of hard labor.

With even those who had once entered the country legally banned from becoming citizens or owning property, Chinese residents of San Francisco crammed into 12 blocks surrounding Portsmouth Square, a plaza which stood at the center of the original Spanish settlement of Yerba Buena. There, within yards of the site where the first American flag in the city had been raised, Chinese immigrants created a self-contained neighborhood that seemed transported from the other side of the world. Chinese characters painted in black and gold hung from buildings, sharing space with lanterns dangling from slanting wooden balconies. Gates decorated with dragons or lions designed to ward off ghosts and other evil spirits enclosed makeshift courtyards. Second-floor brothels and opium dens run by tongs—secret societies that often overlapped with the underworld— catered to the weaknesses of a population that was almost entirely male and became a draw for white tourists and sailors.

For many, their adventure to California was meant to be short-lived, a chance to strike it rich and then return to their villages wealthy men. Wong walked the streets of San Francisco with the top of his head shaved and a long, braided ponytail known as a queue trailing down his back, a symbol of loyalty to the emperor and a necessity for any man wishing to return to China. With only enough money on hand to keep him from starvation, he faced most days clad in a long, flowing black shirt and black pants, the darkness of the cloth hiding its grime. He could neither read nor write, leaving him reliant on his imagination to keep up with the daily life of his family as it unspooled back at home. On days when his loneliness seemed more than he could bear, he spent hours in cramped theaters watching long-winded reenactments of traditional Chinese dramas, aching for anything that offered a sense of familiarity while he was exiled across the Pacific.

He lived in the Globe Hotel, located at the corner of Dupont and Jackson, a ramshackle building known throughout the city for the illegal gambling which took place within its narrow rooms. Nearly three hundred people packed into the four-story structure, creating a notorious tenement that, upon a tour of the establishment, left the San Francisco Chronicle to report, “like rats in a barrel, poor, unwashed heathens crowd together in little cubby-holes.”

Even in a place known for its filth, Wong’s quarters were repellent. His room was located beneath the sidewalk in a space dug out from the original cellar. Liquid from an underground cesspool leaked through the wooden boards lining the room, creating a smell so pungent as to make visitors gag upon entry. A small open pit functioned as his only toilet. He shared his bed with two or three roommates, each man sleeping on the wooden mattress in turn. A solid block of wood served as his pillow. Sticks of burning incense and an untouched glass of wine—meant to curry favor with the gods of health and medicine—sat on a dirty crate in the middle of the room. Above it ran the pipe of an unused sewer line, home to a nest of rats that scampered in the shadows cast by a flickering oil lamp. Dreams, when they did come, allowed Wong to gaze upon the face of his wife and family as they praised him for his sacrifices, a thought that broke the misery of his life.

He continued to work and send remittances to his village until late February 1900, when he noticed a lump in his right groin that was painful to the touch. It soon became difficult to move his leg or urinate without agony. Fearful that he had contracted a venereal disease that would bring him shame, he consulted a prominent physician, Wong Woo, in his office at 766 Clay Street. The doctor confirmed his suspicions and recommended salty foods and cooling herbs to drain the lump, following the traditional Chinese medical approach that regarded illness as a sign of disharmony in the body. Wong returned to his subterranean room and prayed, hoping that his indiscretions would be forgiven.

Over the next few days, his temperature climbed, and he began to lose control of his body, spending his few waking moments alternating between vomiting, diarrhea, and delusions. As it became clear that Wong would not recover, the men sharing his living quarters grew more distant. Cantonese tradition carried a marked aversion to death, lest one become tainted by so-called killing airs that led to bad luck. The practice dated back to the biblical-era Han dynasty and confounded native-born Americans. “Nearly every week the police discover some wretched unfortunate that has been left to die in an underground den by unnatural relatives or friends,” wrote Cosmopolitan magazine. “Medical attention or proper care he will get none. Slow starvation in a noisome cellar, in the hour of thick darkness, with vermin swarming over the helpless sufferer—such is the fate that has befallen many a poor creature in Chinatown.”

Wong’s roommates carried his still-breathing body to a coffin shop two blocks away. Once he was brought inside, he was placed in one of the “halls of tranquility” that Chinese funeral homes maintained for the gravely ill, pungent rooms in which the dying were often placed next to open coffins and the bodies of unburied dead as they waited for the inevitable. There Wong lay until he died on the afternoon of March 6, 1900, a passing altogether unremarkable in a city that had never noticed his existence.

The shop’s owner, Wing Sun, wrapped the body in canvas and prepared a simple pine coffin for burial and eventual retrieval. Funeral home directors were responsible for maintaining the custom of shipping the bones of Chinese immigrants back to their native villages following total decomposition of the flesh. Once back in China, their remains would be reburied in a family plot, allowing the dead to take their place among their ancestors and be worshiped by the living.

“ In a new era of steamships and global trade, it seemed only a matter of time before a plague-infected passenger would step off a dock and into a new city. ”

An assistant city health officer by the name of Frank Wilson entered the coffin shop later that evening as part of his normal rounds, during which he issued burial permits for a fee of three dollars each. Wilson had recently drawn the ire of the acting police chief for signing death certificates that even he admitted were mostly guesswork, and with the help of an interpreter examined Wong’s body with a thoroughness that was unusual for a man who routinely chalked up benign deaths to nonexistent bullet and knife wounds. He soon discovered an egg-shaped black lump on the right groin that he would have never found if he had not been afraid of losing his job. Alarmed by what he saw, Wilson called in his supervisor, Aloysius O’Brien. O’Brien was a surgeon and graduate of the University of California who had been recently reinstated to his position after an argument with his superiors at the Board of Health and, like Wilson, was eager to prove his worth. He inspected the body and instinctively stepped back in fear. There, on the dead man’s groin, was what appeared to be an infected lymph node swollen with blood—a textbook example of a bubo, which gives bubonic plague its name.

Plague had emerged without warning in the rural province of Yunnan in south central China in the late 1870s, unleashing death on a scale not seen in centuries. In China, some ten million people died within a span of five years; by the end of 1910, another five million would perish as plague emerged in India, Australia, Scotland, and North Africa, sparking fears that the Black Death–a 14th-century worldwide outbreak of plague that in some areas killed 60 percent of the population–had returned. In a new era of steamships and global trade, it seemed only a matter of time before a plague-infected passenger would step off a dock and into a new city, unleashing a disease that could kill an otherwise-healthy victim within two days. Now, for the first time, it appeared that the disease had emerged in North America.

Despite the late hour, the men summoned William Kellogg, who had become the city’s first bacteriologist just two months before. Kellogg rushed to the coffin shop and took samples from the dead man’s lymph nodes, taking care to disinfect every instrument that touched the body. Everything before him suggested that the disease had slipped into the city, yet he was hesitant to act. Six months before, an overly-zealous doctor had erroneously identified two Chinese men who had arrived in San Francisco aboard a ship called the Nippon Maru as plague victims, a misidentification which caused a citywide scandal and cost the doctor his job.

Kellogg instead readied tissue samples to take across the bay to the Marine Hospital Service station on Angel Island, where Joseph Kinyoun–a man once known as among the most brilliant doctors in the federal health service until a clash of egos between him and the Surgeon General had led to his banishment to San Francisco–would have the responsibility of announcing to the world that plague had reached American shores. It was a moment that Kinyoun had feared ever since the first case of plague had been reported in Honolulu just three months before. All it would take was for one infected victim to board a train heading East to spread the disease across the continent, enveloping the country in a wave of death that would overwhelm any attempt at containment.

At an emergency Board of Health meeting late that night, spooked health officials took the unprecedented step of imposing what they called a “precautionary” quarantine of Chinatown, essentially sealing a neighborhood that contained nearly 20 percent of the city’s residents with ropes and bayonets. The best they could hope for was that Wong’s death was just a fluke—one diseased man who had somehow bypassed Kinyoun’s officers, not a harbinger of worse things to come.

As Kellogg raced toward the dock, the still of the night was broken by dozens of policemen assembling around the borders of Chinatown. There, lit by moonlight and gas lamps, they unspooled rope and strung it around the district, hoping that it would help curtail the spread of a disease that no one knew how to defeat. San Francisco had long known that plague was a possibility; now it faced an outbreak that if it was not contained could kill millions.

David K. Randall is a senior reporter at Reuters and The New York Times best-selling author of Black Death at the Golden Gate, Dreamland, and The King and Queen of Malibu. He lives in Montclair, New Jersey.