In 1850, it became part of the United States following the Mexican–American War and the admission of California to the union.