California under Spanish and Mexican rule
- Main article: Californian Revolution
Following the French Revolution in the late 18th century, the British colonial governments in eastern North America began an evacuation of British settlers, who fled west in the Great American Exodus. These colonists ultimately formed settlements in the western half of the continent, much of which was then the territory of New Spain. This continued well into the 19th century, and by the 1830s the number of Britons in the region had swelled to over a million, even after New Spain became independent as Mexico. In 1836, British settlers in Texas revolted and won their independence, forming a new republic.
For the first twenty-four years after Mexican independence, California was largely neglected by the government. However, after the Texas Revolution, Mexico threatened the British colonists with expulsion because they had entered without official permission. It proceeded to expand Mexican military presence in the region.