Predators shape the behavior and distribution of prey organisms, driving their evolution and environmental impact. We studied relationships between interspecific competition and predation risk in Ponto-Caspian invasive gammarid crustaceans: Pontogammarus robustoides and Dikerogammarus villosus. We hypothesized that a stronger competitor D. villosus would displace P. robustoides from a preferred habitat, but the frequency of this displacement would be reduced in the presence of a higher fish predator, the racer goby. We studied gammarid preferences for stone or sand substrata in 24-h pairwise-choice tests in single-species or mixed-species treatments, at 2 densities (12 or 24 individuals per tank), in the presence or absence of a predator. D. villosus displaced P. robustoides from the stone habitat, even at the low density. As P. robustoides tested separately preferred stones at both densities, its displacement resulted from active avoidance of a stronger competitor even when the substratum was not actually a limited resource. The presence of a predator reduced the number of instances of displacement of P. robustoides by D. villosus, allowing the weaker species to stay on its preferred substratum. Nevertheless, the presence of D. villosus still increased fish predation on P. robustoides. The presence of a predator modifies relationships between prey organisms, allowing a weaker competitor to stay in its preferred habitat. Thus, antipredator responses of prey organisms may have cascading effects on the functioning of the community, affecting habitat choice and competition among species.