qnli question: What year did Mexico gain independence from Spain? sentence: Eventually the town came to be called "Tucson" and became a part of Sonora after Mexico gained independence from Spain in 1821.