Below is a list of the governors of early California (1769–1850), before its admission as the 31st U.S. state. First explored by , with colonies established at San Diego and Monterey, California was a remote, sparsely-settled Spanish province of New Spain. In 1822, following Mexican independence, California became part of Mexico. In 1836, a coup led by and eventually resulted in Alvarado becoming governor. That conflict ended in 1838, when the central government of Mexico recognized Alvarado as California Governor. The territorial (legislature) approved the appointment. Another disputed governorship occurred in 1844, settled when another Californio, Pio Pico, became the last Governor of Mexican California. In 1846, the "Bear Flag Revolt" in Sonoma declared California an independent republic—the "Bear Flag Republic". No government was formed, however, and the revolt did not have time to spread very far because California came under U.S. military occupation at the outset of the Mexican–American War less than a month later. California was ceded to the U.S. in 1848, and was admitted as the 31st U.S. state on September 9, 1850. Peter Burnett, the last governor of the post-war military territory, became its first state governor after admission. Spanish rule (1769–1822) The Spanish Empire established its rule in the Californias in 1769. During this time, the Californias encompassed a massive territorial expanse, including both Alta California (present day U.S. state of California) and Baja California (present day Mexican states of Baja California and Baja California Sur), which were governed under a military administration led by the Governor of the Californias. In 1804, the Californias were officially divided into two administrations: Alta California, based in Monterey, and Baja California, based in Loreto. Spanish governors of the Californias (1769–1804) From 1769 to 1804, the Californias were governed as one administrative unit within the Spanish Empire. Following 1804, Alta California and Baja California each had their own administration. Spanish governors of Alta California (1804–1822) Following the division of the Californias in 1804, Alta California came to have its own administration. José Joaquín de Arrillaga, who had served as Governor of the Californias until 1804 subsequently served as the first governor of Alta California. Mexican rule (1822–1846) Following the Mexican War of Independence from the Spanish, both of the Californias became part of the newly-independent Mexico in 1822. Mexican rule was interrupted from 1836 to 1838 by the Californio independence movement led by Juan Bautista Alvarado, who was acclaimed