The Kansas Pacific Railway (KP) was a historic railroad company that operated in the western United States in the late 19th century. It was a federally chartered railroad, backed with government land grants. At a time when the first transcontinental railroad was being constructed by the Central Pacific and the Union Pacific, it tried and failed to join the transcontinental ranks.  It was originally the "Union Pacific, Eastern Division", although it was completely independent. The Pennsylvania Railroad, working with Missouri financiers, designed it as a feeder line to the transcontinental system. The owners lobbied heavily in Washington for money to build a railroad from Kansas City to Colorado, and then to California. It failed to get funding to go west of Colorado. It operated many of the first long-distance lines in the state of Kansas in the 1870s, extending the national railway network westward across that state and into Colorado. Its main line furnished a principal transportation route that opened up settlement of the central Great Plains, and its link from Kansas City to Denver provided the last link in the coast-to-coast railway network in 1870. The railroad was consolidated with the Union Pacific in 1880, and its mainline continues to be an integral part of the Union Pacific network today.
 The Kansas Pacific began in 1855 as the Leavenworth, Pawnee and Western Railroad, and was later reorganized in 1863 as the Union Pacific Eastern Division. The UP Eastern was authorized by the United States Congress as part of the Pacific Railway Act, in order to create a second southerly branch of the transcontinental railroad, alongside the Union Pacific. The name "Kansas Pacific" was not adopted until 1869.  The original intent of the railroad was to build a line west from Kansas City, Kansas across Kansas to Fort Riley, then north to join the Union Pacific main line at Fort Kearny in Nebraska. The construction of the line was motivated in part by the desire of the U.S. government to extend  transportation routes into Kansas, which had been the scene of ongoing conflict between future Union and Confederate sympathizers even prior to the start of the American Civil War (1861-1865). See Bleeding Kansas.
 The company began construction on its main line westward from Kansas City in September 1863. In 1864, the first 40 miles (64 km) of the line to Lawrence was in operation. In the fall of 1866, the line had reached Junction City, which became the end of the first division of the railroad and where a roundhouse was constructed. In 1867 the line reached to Salina.  In March 1869, the name was changed by Act of the United States Congress to the Kansas Pacific. As in the case with the Union Pacific, the Pacific Railway Act authorized large land grants to the railroad along its mainline. Such grants were to be distributed to homesteaders who would populate the lands near the railroad, forming new towns and providing the economic activity needed to support the railroad itself. During the construction, William F. "Buffalo Bill" Cody was employed to shoot buffalo to provide meat for the track laying crews.
 Although the railroad had intended originally to build only as far west as Fort Riley, citizens in Denver in the Colorado Territory, eager to be connected to national network, lobbied furiously to extend the Union Pacific lines to reach their city. In 1868, the U.S. Congress enacted a law that was signed by President Andrew Johnson to build a second-phase extension of the line to the Rocky Mountains, with the intention of continuing past Denver through the Rocky Mountains to the Pacific, to compete with the Union Pacific main line.  No funds were granted for the construction, however, a situation made more dire by the general collapse in railroad investments following the end of the  American Civil War.
 With the backing of German investors, the Kansas Pacific (KP) began construction on the Colorado extension in October 1869. By March 1870, the westward line had reached Kit Carson, Colorado, and the company began to build eastward from Denver. On August 15, 1870, the two KP branches met on the Colorado Eastern Plains at Comanche Crossing, which was renamed Strasburg in honor of an engineer of the Kansas Pacific.
 The arrival of the first trains to Denver in August was two months after the completion in June 1870 of the Denver Pacific Railway main line linking Denver with the Union Pacific at Cheyenne in the Nebraska Territory. The Kansas Pacific and Denver Pacific lines intersected at the Denver "Jersey Junction", approximately three miles north of downtown. The Strasburg "joining of the rails" of the  Kansas Pacific on August 15, 1870 actually marked the completion of a true coast-to-coast railway network in the United States. The Golden spike event in Utah the previous year had marked the linking of the Union Pacific with the Central Pacific Railroad, but until 1872, passengers were required to disembark between Council Bluffs, Iowa and Omaha, Nebraska to cross the Missouri River by boat.
 In 1874, Union Pacific investor Jay Gould gained effective control of the Kansas Pacific. In 1880, Kansas Pacific and Denver Pacific were consolidated at Gould's direction into the Union Pacific.  The company's intention to extend the old Kansas Pacific main line through the Rockies was strengthened by renewed competition from its arch-rival, the Chicago, Burlington and Quincy. In the early 1880s, the Union Pacific sent surveyors on several expeditions up the Platte Canyon and the Poudre Canyon. When the Burlington withdrew its plans for its own transcontinental line, however, the Union Pacific lost interest in extending a line west from Denver. It was not until 1934, with the completion of the Dotsero Cutoff, connecting the mainline of the Denver and Salt Lake Railroad with the Denver and Rio Grande Western mainline, that the standard gauge rail network west from Denver would cross the Rockies and reach Salt Lake City.
 In 1885, the railroad went before the Supreme Court in Kansas Pacific R. Co. v. Dunmeyer in a dispute over land titles.
 The struggle to build the railway against the backdrop of the American Civil War was depicted in the 1953 western movie Kansas Pacific, starring Sterling Hayden and Eve Miller.
 In Superman (1978 film), Lois Lane as a girl is shown riding with her parents on a Kansas Pacific passenger train through Smallville, Kansas, boyhood home of Clark Kent.