Valparaíso's population at independence (in 1818) was barely 5000, but demand for Chilean wheat (brought on by the California gold rush) prompted such a boom that shortly after the mid-18th century the city's population was about 55, 000. Completion of the railroad from Santiago helped to boost the city's population further, and by 1880 it exceeded 100, 000. As the first major port of call for ships coming around Cape Horn, the city became a commercial center for the entire Pacific coast and the hub of Chile's nascent banking industry.
A major earthquake in 1906 destroyed many downtown buildings, though some impressive 19th-century architecture remains. The opening of the Panama Canal, soon after, was a further economic blow, as European shipping avoided the longer, more arduous Cape Horn route. Falling demand for Chilean mineral exports cut Valparaíso's maritime commerce still further. Not until after WWII was there significant recovery, as the country began to industrialize.
Valparaíso is still an important center of maritime trading, although the city of San Antonio is now the country's largest port. The navy's conspicuous presence remains an important factor in the city's economy.