Adams–Onís Treaty
The Adams–Onís Treaty of 1819, between the United States and Spain, established the northern limit of Alta California at latitude 42°N, which remains the boundary between the states of California, Nevada and Utah (to the south) and Oregon and Idaho (to the north) to this day. Mexico won independence in 1821, and Alta California became a territory of Mexico the next year.