Food choice has profound implications for the relative intakes of water and salts, and thus for an animal’s physiological state. Discrimination behaviors with respect salt intake have been documented in a number of vertebrate species, but few studies have considered the ecological context in which they occur. Here, we report on the results of a 2-choice experiment designed to examine the influence of dietary salt content and freshwater availability in food discrimination behaviors in red knots Calidris canutus (Aves: Scolopacidae) that feed on mud snails Peringia ulvae (Gastropoda: Hydrobiidae) whose body fluids have either relatively low (25‰) or high (42‰) salinity. Birds ate more and spent longer time foraging on low-salinity mud snails when their salt gland sizes—an indicator of excretory capacity—were relatively small and when they were deprived of freshwater. However, as they enlarged salt glands—following a prolonged exposure to salty diet without access to freshwater—and regained access to freshwater, their preference for low-salinity prey disappeared. Such a change of preference illustrates the context dependency of discrimination. As the birds were able to maintain salt–water balance—inferred from plasma sodium concentration—under all conditions, changes in salinity preferences may occur without measurable physiological signs of osmotic stress. Our results highlight the importance of ecological context for understanding foraging responses. We argue that areas with high salinities could act as refuges for euryhaline invertebrates and fish from top vertebrate predators.