Bayan samun 'yancin kai daga Spain a 1821, yankin ya zama wani ɓangare na Mexico. A karkashin mulkin Mexico, tsarin aikin ya ƙare a hankali, kuma ƙasashenta sun zama masu zaman kansu. A 1835, ɗan Ingila William Richardson ya gina gida na farko mai zaman kansa, kusa da jirgin ruwa a kusa da abin da ke yau Portsmouth Square. Tare da Alcalde Francisco de Haro, ya tsara shirin titi don fadada ƙauyen, kuma garin, mai suna Yerba Buena, ya fara jawo hankalin mazauna Amurka. Commodore John D. Sloat ya yi ikirarin California ga Amurka a ranar 7 ga Yuli, 1846, a lokacin Yaƙin Mexico da Amurka, kuma Kyaftin John B. Montgomery ya isa ya yi ikirarin Yerba Buena kwana biyu bayan haka. An sake suna Yerba Buena zuwa San Francisco a ranar 30 ga Janairu na shekara mai zuwa, kuma Mexico ta ba da izinin yankin ga Amurka a ƙarshen yakin.
Yerba Buena