The Treaty of Guadalupe Hidalgo, signed on February 2, 1848, marked the end of the Mexican–American War. In that treaty, the United States agreed to pay Mexico $18,250,000; Mexico formally ceded California (and other northern territories) to the United States; and the first international boundary was drawn between the U.S. and Mexico by treaty. The previous boundary had been negotiated in 1819 between Spain and the United States in the Adams–Onís Treaty, which established the present border between California and Oregon. San Diego Bay is one of the few natural harbors in California south of San Francisco, and to claim this strategic asset the southern border was slanted to include the entire bay in California.