Soon the river turns west, crossing the boundary of Yosemite National Park and the Sierra National Forest and entering the foothills of the Sierra Nevada, and merges with the Merced River some 25 miles downstream of the end of Yosemite Valley.