The costs and benefits of group living often depend on the spatial position of individuals within groups and the ability of individuals to occupy preferred positions. For example, models of predation events for moving prey groups predict higher mortality risk for individuals at the periphery and front of groups. We investigated these predictions in sardine () schools under attack from group hunting sailfish () in the open ocean. Sailfish approached sardine schools about equally often from the front and rear, but prior to attack there was a chasing period in which sardines attempted to swim away from the predator. Consequently, all sailfish attacks were directed at the rear and peripheral positions of the school, resulting in higher predation risk for individuals at these positions. During attacks, sailfish slash at sardines with their bill causing prey injury including scale removal and tissue damage. Sardines injured in previous attacks were more often found in the rear half of the school than in the front half. Moreover, injured fish had lower tail-beat frequencies and lagged behind uninjured fish. Injuries inflicted by sailfish bills may, therefore, hinder prey swimming speed and drive spatial sorting in prey schools through passive self-assortment. We found only partial support for the theoretical predictions from current predator-prey models, highlighting the importance of incorporating more realistic predator-prey dynamics into these models.This article is part of the themed issue 'Physiological determinants of social behaviour in animals'.