Los Angeles changed rapidly after 1848, when California was transferred to the United States as a result of the Treaty of Guadalupe Hidalgo that ended the Mexican-American War. Much greater changes were to come from the completion of the Transcontinental Railroad in 1876. For the next 120 years of Los Angeles' growth, it was plagued by often violent ethnic and class conflict, reflected in the struggle over who would control the city's identity, image, geography and history.