Mexico gained independence from Spain in 1821 and in the following year Alta California (as California then was known) became a province of the new country. From c. 1825-1835, Mexico attempted to exert control over the area, but with little success.