We developed a novel statistical model to relate the daily survival and migration dynamics of an endangered anadromous fish to river flow and water temperature during both extreme drought and severe flooding in an intensively managed river system. Our Bayesian temporally stratified multistate mark recapture model integrates over unobserved travel times and route transitions to efficiently estimate covariate relationships and includes an adjustment for telemetry tag battery failure. We applied the model to acoustic-tagged juvenile Sacramento river winter-run Chinook salmon (Oncorhynchus tshawytscha) and found that survival decreased with decreasing river flows and increased water temperatures. We found that fish were likely to enter at a large floodplain during flood conditions and that survival in floodplain was comparable to the mainstem Sacramento river. Our study demonstrates the response of an endangered anadromous fish population to extreme spatial and temporal variability in habitat accessibility and quality. The general model framework we introduce here can be applied to telemetry of migratory fish through systems with multiple routes to efficiently estimate spatiotemporal variation in survival, travel time, and routing.