© 2016 European Society for Evolutionary Biology. According to kin selection theory, individuals show less aggression towards their relatives. Limited dispersal promotes interactions among relatives but also increases competition among them. The evolution of cooperation in viscous populations has been subject of mainly theoretical exploration. We investigated the influence of relatedness on aggression in males of entomopathogenic nematode Steinernema longicaudum that engage in lethal fighting. In a series of in vitro experiments, we found that both competitor male group size and relatedness influence male mortality rates. Higher relatedness led to progressively lower rates of male mortality. In experimentally infected insects, wherein large numbers of males and females interact, the proportion of dead and paralysed (= terminally injured) males was higher when infection was established by infective juveniles originating from a mixture of three lines than in those infected by a single line. The results collectively show that Steinernema longicaudum males recognize their kin and consequently male mortality rates are lower in groups consisting of more related males. Furthermore, this monotonic negative relationship between aggression and relatedness suggests that kin selection benefits are still substantial even under extreme competition. Our experiments also suggest that kin recognition in entomopathogenic nematodes has a genetic basis rather than being strictly based on environmental cues. We discuss our findings within the theoretical context of the evolution of altruistic/cooperative behaviour in structured populations.