The nation’s firsttranscontinental railroad, completed 150 years ago today at Promontory Summit in Utah, connected the vast United States and brought America into the modern age. Chinese immigrants contributed mightily to this feat, but the historical accounts that followed often marginalized their role.

Between 1863 and 1869, as many as 20,000 Chinese workers helped build the treacherous western portion of the railroad, a winding ribbon of track known as the Central Pacific that began in Sacramento.

At first, the Central Pacific Railroad’s directors wanted a whites-only workforce. Leland Stanford, the railroad’s president, had advocated for keeping Asians out of the state in his 1862 inaugural address as governor of California. When not enough white men signed up, the railroad began hiring Chinese men for the backbreaking labor. No women worked on the line.

Company leaders were skeptical of the new recruits’ ability to do the work, but the Chinese laborers proved themselves more than capable — and the railroad barons came to consider them superior to the other workers.

My colleagues and I initiated an international research project — based, appropriately, at Stanford University — to investigate the enormous contribution Chinese workers made to the transcontinental project. It proved to be a formidable task, not least because no written record produced by what were called “railroad Chinese” is known to exist. Without letters, diaries and other primary sources that are historians’ stock in trade, we amassed a sizable collection of evidence that included archaeological findings, ship manifests, payroll records, photographs and observers’ accounts.

The material allowed us to recover a sense of the lived experiences of the thousands of Chinese migrants Leland Stanford came to greatly admire. He told President Andrew Johnson that the Chinese were indispensable to building the railroad: They were “quiet, peaceable, patient, industrious and economical.” In a stockholder report, Stanford described construction as a “herculean task” and said it had been accomplished thanks to the Chinese, who made up 90% of the Central Pacific Railroad’s labor force.

These workers showed their mettle, and sealed their legacy, on the peaks of the Sierra Nevada. Many observers at the time had assumed that Stanford and the railroad were daft for thinking they could link California with the East because an immense mountain range separated the state from Nevada and beyond. The Sierra Nevada is a rugged, formidable range, its inhospitableness encapsulated by the gruesome tragedy of the Donner party in 1847 and 1848. Trapped by winter storms in the mountains, they resorted to cannibalism.

To get to the High Sierra, Chinese workers cut through dense forests, filled deep ravines, constructed long trestles and built enormous retaining walls — some of which remain intact today. All work was done by hand using carts, shovels and picks but no machinery.

The greatest challenge was to push the line through the Sierra summit. Solid granite peaks soared to 14,000 feet in elevation. The railroad bed snaked through passes at more than 7,000 feet. The men who came from humid south China labored through two of the worst winters on record, surviving in caverns dug beneath the snow.

They blasted out 15 tunnels, the longest nearly 1,700 feet. To speed up the carving of the tunnels, the Chinese laborers worked from several directions. After opening portals along the rock face on either side of the mountain, they dug an 80-foot shaft down to the estimated midway point. From there, they carved out toward the portals, doubling the rate of progress by tunneling from both sides. It still took two years to accomplish the task.

The Chinese workers were paid 30% to 50% less than their white counterparts and were given the most dangerous work. In June 1867, they protested. Three-thousand workers along the railroad route went on strike, demanding wage parity, better working conditions and shorter hours. At the time it was the largest worker action in American history. The railroad refused to negotiate but eventually raised the Chinese workers’ pay, though not to parity.

After the Sierra, the Chinese workers faced the blistering heat of the Nevada and Utah deserts, yet they drove ahead at an astonishing rate.

As they approached the meeting point with the Union Pacific, thousands of them laid down a phenomenal 10 miles of track in less than 24 hours, a record that has never been equaled. A Civil War officer who witnessed the drama declared that the Chinese were “just like an army marching over the ground and leaving the track behind.”

Progress came at great cost: Many Chinese laborers died along the Central Pacific route. The company kept no records of deaths. But soon after the line was completed, Chinese civic organizations retrieved an estimated 1,200 bodies along the route and sent them home to China for burial.

The transcontinental railroad’s completion allowed travelers to journey across the country in a week — a trip that had previously taken more than a month. Politicians pointed to the achievement as they declared the United States the leading nation of the world.

The transcontinental railroad has been viewed in a similarly nationalistic way ever since. Chinese workers were often left out of the official story because their alienage and suffering did not fit well with celebration. And attitudes toward them soon soured, with anti-Chinese riots sweeping the country. The Chinese Exclusion Act of 1882 barred Chinese laborers from entering the United States and placed restrictions on those already here.

Federal immigration law prohibited Chinese citizens from becoming Americans until 1943.

As a faculty member of the university that bears his name, I am painfully aware that Leland Stanford became one of the world’s richest men by using Chinese labor. But I also try to remember that Stanford University exists because of those Chinese workers. Without them, Leland Stanford would probably be at best a footnote in history — and the West and the United States would not exist as we know it today.

Gordon H. Chang is a professor of history at Stanford University.