An express train called the Transcontinental Express arrives in San Francisco, via the First Transcontinental Railroad only 83 hours and 39 minutes after leaving New York City.

North America's first transcontinental railroad (known originally as the "Pacific Railroad" and later as the "Overland Route") was a 1,911-mile (3,075 km) continuous railroad line constructed between 1863 and 1869 that connected the existing eastern U.S. rail network at Council Bluffs, Iowa with the Pacific coast at the Oakland Long Wharf on San Francisco Bay. The rail line was built by three private companies over public lands provided by extensive US land grants. Building was financed by both state and US government subsidy bonds as well as by company issued mortgage bonds. The Western Pacific Railroad Company built 132 miles (212 km) of track from the road's western terminus at Alameda/Oakland to Sacramento, California. The Central Pacific Railroad Company of California (CPRR) constructed 690 miles (1,110 km) east from Sacramento to Promontory Summit, Utah Territory. The Union Pacific Railroad (UPRR) built 1,085 miles (1,746 km) from the road's eastern terminus at the Missouri River settlements of Council Bluffs and Omaha, Nebraska westward to Promontory Summit.The railroad opened for through traffic between Sacramento and Omaha on May 10, 1869, when CPRR President Leland Stanford ceremonially tapped the gold "Last Spike" (later often referred to as the "Golden Spike") with a silver hammer at Promontory Summit. In the following six months, the last leg from Sacramento to San Francisco Bay was completed. The resulting coast-to-coast railroad connection revolutionized the settlement and economy of the American West. It brought the western states and territories into alignment with the northern Union states and made transporting passengers and goods coast-to-coast considerably quicker, safer and less expensive.

The first transcontinental rail passengers arrived at the Pacific Railroad's original western terminus at the Alameda Terminal on September 6, 1869, where they transferred to the steamer Alameda for transport across the Bay to San Francisco. The road's rail terminus was moved two months later to the Oakland Long Wharf, about a mile to the north, when its expansion was completed and opened for passengers on November 8, 1869. Service between San Francisco and Oakland Pier continued to be provided by ferry.

The CPRR eventually purchased 53 miles (85 km) of UPRR-built grade from Promontory Summit (MP 828) to Ogden, Utah Territory (MP 881), which became the interchange point between trains of the two roads. The transcontinental line became popularly known as the Overland Route after the name of the principal passenger rail service to Chicago that operated over the length of the line until 1962.

In rail transport, a train is a series of connected vehicles that run along a railway track and transport people or freight. The word train comes from the Old French trahiner, derived from the Latin trahere meaning "to pull, to draw". Trains are typically pulled or pushed by locomotives (often known simply as "engines"), though some are self-propelled, such as multiple units. Passengers and cargo are carried in railroad cars, also known as wagons. Trains are designed to a certain gauge, or distance between rails. Most trains operate on steel tracks with steel wheels, the low friction of which makes them more efficient than other forms of transport.

Trains have their roots in wagonways, which used railway tracks and were powered by horses or pulled by cables. Following the invention of the steam locomotive in the United Kingdom in 1804, trains rapidly spread around the world, allowing freight and passengers to move over land faster and cheaper than ever possible before. Rapid transit and trams were first built in the late 1800s to transport large numbers of people in and around cities. Beginning in the 1920s, and accelerating following World War II, diesel and electric locomotives replaced steam as the means of motive power. Following the development of cars, trucks, and extensive networks of highways which offered greater mobility, as well as faster airplanes, trains declined in importance and market share, and many rail lines were abandoned. The spread of buses led to the closure of many rapid transit and tram systems during this time as well.

Since the 1970s, governments, environmentalists, and train advocates have promoted increased use of trains due to their greater fuel efficiency and lower greenhouse gas emissions compared to other modes of land transport. High-speed rail, first built in the 1960s, has proven competitive with cars and planes over short to medium distances. Commuter rail has grown in importance since the 1970s as an alternative to congested highways and a means to promote development, as has light rail in the 21st century. Freight trains remain important for the transport of bulk commodities such as coal and grain, as well as being a means of reducing road traffic congestion by freight trucks.

While conventional trains operate on relatively flat tracks with two rails, a number of specialized trains exist which are significantly different in their mode of operation. Monorails operate on a single rail, while funiculars and rack railways are uniquely designed to traverse steep slopes. Experimental trains such as high speed maglevs, which use magnetic levitation to float above a guideway, are under development in the 2020s and offer higher speeds than even the fastest conventional trains. Development of trains which use alternative fuels such as natural gas and hydrogen is another 21st century development.