Mexico gained its independence from Spain in 1822–in general (though the specifics were different), for much the same political and economic reasons our Thirteen Colonies declared their independence from England in 1776. The new Republic of Mexico also took control of Spain’s former conquests extending from coastal California to the eastern border of Texas. Between 1822 and 1848, when the United States acquired California in the Treaty of Guadalupe Hidalgo, Mexico sequentially installed seventeen governors (Pio Pico served twice) in their inherited province. The original capital of California was at Monterey, established by Spain in 1770. Governor Pio Pico briefly moved the capital to Los Angeles during his second term in 1845-1846.