The Nisenan (Southern Maidu) and Plains Miwok peoples lived along these rivers, fishing salmon and gathering acorns. In 1839 the Swiss immigrant John Sutter received a Mexican land grant and built an adobe fort he called New Helvetia.
In January 1848, James Marshall, building a sawmill for Sutter at Coloma in the foothills, found gold in the American River. The news set off the California Gold Rush: hundreds of thousands of fortune seekers poured in, and Sacramento grew almost overnight at the river landing as the supply town for the mines. It became the state capital in 1854.
Sacramento was the western end of the Pony Express in 1860–61, and in 1863 the Central Pacific Railroad, backed by four local merchants known as the "Big Four" (Stanford, Huntington, Hopkins and Crocker), began building east from here; it met the Union Pacific in Utah in 1869, completing the first transcontinental railroad. Chinese labourers did much of the hardest work. Repeated floods led the city to raise its downtown streets by a storey in the 1860s and 1870s — the "Sacramento Underground" — and Old Sacramento's restored buildings date from that era.