Prey seek to minimize predation risk by moving across the landscape in search of safer areas. Yet, these movements are associated with risks that depend on the intrinsic attributes of the species involved. We evaluated the effect of presence of an apex predator (Puma concolor) on the composition of a community of medium and large-bodied terrestrial mammal species in 23 forest fragments in the State of São Paulo, Brazil, based on overnight footprint surveys over 2 y. We tested if (1) presence of the puma decreases species richness (prey and mesopredator), (2) landscape features interact with puma effects, altering the composition and richness of prey, (3) darker nights strengthen the predation risk effects of puma and (4) this effect can vary among prey species. The puma reduced the richness of prey species by ~45% and presence of mesopredator by 11%. Larger forest fragments and darker nights strengthened the effects of puma on the mammal community. Most prey species showed negative associations with the apex predator, while others were unaffected or showed a positive association. These results add new knowledge about the effects of predation risk and of the landscape characteristics on the composition of the mammal community and the behaviour of different species. Furthermore, our results indicate that medium and large mammals live in a landscape of fear in Neotropical forest remnants.