
In 1769, the Europeans, then the Spaniards, came across San Francisco Bay. In 1776, the Spanish built a military installation at the tip of the San Francisco peninsula and built the mission San Francisco de Asis (Saint Francis of Assisi).
This tiny northern Spanish, then Mexican, outpost was insignificant for decades.
In 1835, British Captain William Richardson built a private settlement, east of the Mexican mission on the shore of Yerba Buena Cove, with the same name. The U.S. government made an offer to buy the bay, but the Mexicans refused.
On July 9, 1846, American naval Captain John Montgomery sailed his warship into San Francisco Bay. A dispute between the U.S. and Mexico, a little over a decade later, over western Texas led to war.
Montgomery led a party of marines and sailors ashore and occupied the small settlement of Yerba Buena.
They met no resistance and claimed the settlement for the United States, raising the American flag in the central plaza.
Yerba Buena was later renamed San Francisco.
San Francisco was a small town with approximately 900 people when the Mexican government formally gave California to the U.S. in the 1848 Treaty of Guadalupe.
That same year, gold was found nearby, at Sutter's Fort. San Francisco became the hub for the American Gold Rush, and by 1852, just a few years later, the population of San Francisco grew to 36,000.