In the stormy period when California was under US military rule after the defeat of the Mexicans, Governor Richard Barnes Mason appointed the 26-year-old Foster alcalde (mayor) of Los Angeles to replace the dissolved ayuntamiento (government) of the Mexicans.
Mason appointed José del Carmen Lugo, a prominent and mature Californio, as mayor following Foster.