qnli question: What treaty was used by Stockton and Kearny on January 1, 1847? sentence: As a result of the Mexican–American War of 1846–48, the territory of Alta California, including San Diego, was ceded to the United States by Mexico, under the terms of the Treaty of Guadalupe Hidalgo in 1848.