The Atlantic & Pacific's earliest predecessor was the Pacific Railroad, incorporated by the Missouri General Assembly in 1849 to connect St. Louis and a point south of Kansas City across the center of the state. In response to an 1852 federal law granting public lands to Missouri to aid in constructing two cross-state railroads, the state approved an amendment to the 1849 Pacific Railroad law in December 1852, adding a Southwest Branch that would receive the grants. The new branch, defined by state law to lie south of the Osage River, began at Franklin, Missouri,(now Pacific) on the main line and headed west-southwesterly across the state. Construction on 71 miles from Franklin to Dillon was completed in 1860, and a further 6 miles to Rolla were opened in 1861. The company graded 12 miles more to Arlington, but after it defaulted on bonds that had been issued for the branch, the state seized the road from Franklin to Rolla and incomplete roadbed to Arlington in March 1866. The property was sold in June for $1.3 million to explorer and politician John C. Frémont, who reorganized it as the Southwest Pacific Railroad in September. (The main line of the Pacific Railroad was not sold, and would later become the Missouri Pacific Railroad.)
In July 1866, Congress passed a law incorporating the Atlantic and Pacific Railroad under control of Frémont and associates. The company was given the power to build near the 35th parallel from Springfield, Missouri west to the Pacific, with a branch from Van Buren, Arkansas. In exchange for its completion by 1878, the railroad would receive land grants along its route. The same conditions were applied to the Southern Pacific Railroad of California, which could build a branch to connect to the A&P near the eastern border of that state. The A&P purchased the Southwest Pacific in January 1867, and that year rails were laid on the grade to Arlington. That company, too, defaulted on its payments, and the state of Missouri again seized the property in June 1867, selling it to a new South Pacific Railroad in July 1868. Ownership of the A&P was also transferred to the new owners, which included Clinton B. Fisk of St. Louis. Another 164 miles to Pierce City and 39 miles of grading to Seneca on the state line were completed in 1870, when, in October, the South Pacific sold its property to the A&P. That company laid rails to Neosho that year and to Seneca, and beyond to Vinita, Oklahoma, in 1871, and in June 1872 it leased the Pacific (later Missouri Pacific) Railroad, which operated a line to Kansas City and branches, including several into Kansas. The A&P's only branch, 1.5 miles to a mine near Granby, Missouri, was built in 1875.
But this incarnation had similar financial problems; its Missouri division (Franklin to Seneca) was placed under receivership in November 1875, and the Pacific Railroad lease was canceled. The owners of the A&P incorporated the St. Louis and San Francisco Railway in September 1876, and immediately acquired the property of the Missouri division, and a lease on the Central division (Seneca to Vinita). Extensions beyond Vinita for 64 miles to Tulsa (1882), 4 miles to Red Fork (1885), and 10 miles to Sapulpa (1886) were included in the lease. The SL&SF also constructed a direct line into St. Louis in 1883, ending its dependence on the Missouri Pacific for access to that city.
In January 1880, the SL&SF came to an agreement with the Atchison, Topeka and Santa Fe Railroad, which had recently entered New Mexico from the north, whereby the two companies would jointly control the A&P. The SL&SF would continue to operate the Central division, and a new Western division would begin on the AT&SF at Isleta, New Mexico and head west to meet the Southern Pacific at Needles, California. Construction began that year, and reached Kingman, Arizona in 1882. The SP began building a branch from Mojave, California that same year, east to Needles, where the two met on August 9, 1883. The A&P, then essentially an operating subsidiary of the AT&SF, leased the line from the SP in August 1884, and in November 1885 the AT&SF-owned California Southern Railroad completed its line over Cajon Pass to the SP's Needles branch at Barstow, giving the AT&SF access to the coast. In addition to its lease of the SP to Mojave, the A&P operated via trackage rights over the AT&SF from Isleta to Albuquerque.
The AT&SF gained control of the SL&SF in 1890, but both companies entered receivership in the December after the Panic of 1893, and the A&P followed in January 1894. That road's Western division was sold to the newly created AT&SF subsidiary Santa Fe Pacific Railroad in June 1897, and the remaining Central division was sold under foreclosure to the reorganized SL&SF, which was again independent of the AT&SF, in December 1897, ending the A&P's existence. Through the Santa Fe Pacific, the AT&SF acquired trackage rights in January 1899 over the SP's Tehachapi Pass line, giving it access to the Central Valley of California and San Francisco Bay Area. The Santa Fe Pacific left the SP at Kern Junction, where the San Francisco and San Joaquin Valley Railway - another AT&SF subsidiary - began, and operated into Bakersfield via SF&SJV trackage. The AT&SF bought the railroad property of the Santa Fe Pacific in July 1902, and its non-operating subsidiary California, Arizona and Santa Fe Railway bought the leased Southern Pacific line between Mojave and Needles in December 1911, but the Santa Fe Pacific Railroad continued to own its land grants from the A&P, and in fact still exists as a subsidiary of the Burlington Northern Santa Fe Corporation, successor to the AT&SF. The gap across Oklahoma, Texas, and New Mexico was eventually filled in 1904, when the Arkansas Valley and Western Railway, an SL&SF subsidiary, completed its line from Tulsa to Avard, Oklahoma, on the AT&SF's line through the Texas Panhandle. The line was joined under one company in 1995, when the AT&SF merged with SL&SF successor Burlington Northern Railroad to form the BNSF Railway, and remains a main line.