Miwok and Paiute people lived along the river for thousands of years before Spanish and Mexican military expeditions passed through in the early 19th century. The California Gold Rush brought many people into California and some settled in towns along the lower Merced River. A railroad was built along the Merced canyon, enabling mining and logging in the upper watershed, and later carrying tourists to Yosemite National Park. Conflicts between settlers and indigenous peoples resulted in wars, including the expulsion of the Ahwahnechee from Yosemite.