On May 10, 1869, the presidents of the Union Pacific and Central Pacific railroads meet in Promontory, Utah, and drive a ceremonial last spike into a rail line that connects their railroads. This made transcontinental railroad travel possible for the first time in U.S. history. No longer would western-bound travelers need to take the long and dangerous journey by wagon train, and the West would surely lose some of its wild charm with the new connection to the civilized East.

READ MORE: 10 Ways the Transcontinental Railroad Changed America

Since at least 1832, both Eastern and frontier statesmen realized a need to connect the two coasts. It was not until 1853, though, that Congress appropriated funds to survey several routes for the transcontinental railroad. The actual building of the railroad would have to wait even longer, as North-South tensions prevented Congress from reaching an agreement on where the line would begin.

One year into the Civil War, a Republican-controlled Congress passed the Pacific Railroad Act (1862), guaranteeing public land grants and loans to the two railroads it chose to build the transcontinental line, the Union Pacific and the Central Pacific. With these in hand, the railroads began work in 1866 from Omaha and Sacramento, forging a northern route across the country. In their eagerness for land, the two lines built right past each other, and the final meeting place had to be renegotiated.

Harsh winters, staggering summer heat, Indian raids and the lawless, rough-and-tumble conditions of newly settled western towns made conditions for the Union Pacific laborers–mainly Civil War veterans of Irish descent–miserable. The overwhelmingly immigrant Chinese work force of the Central Pacific also had its fair share of problems, including brutal 12-hour work days laying tracks over the Sierra Nevada Mountains. On more than one occasion, whole crews would be lost to avalanches, or mishaps with explosives would leave several dead.

READ MORE: 10 Ways the Transcontinental Railroad Changed America

For all the adversity they suffered, the Union Pacific and Central Pacific workers were able to finish the railroad–laying nearly 2,000 miles of track–by 1869, ahead of schedule and under budget. Journeys that had taken months by wagon train or weeks by boat now took only days. Their work had an immediate impact: The years following the construction of the railway were years of rapid growth and expansion for the United States, due in large part to the speed and ease of travel that the railroad provided.