The Mexicans ruled the city until 1847, when, as a result of the Mexican-American War, the Americans took control of Los Angeles.