Recent years have seen great interest in the suggestion that between-group aggression and within-group altruism have coevolved. However, these efforts have neglected the possibility that warfare – via its impact on demography – might influence human social behaviours more widely, not just those directly connected to success in war. Moreover, the potential for sex differences in the demography of warfare to translate into sex differences in social behaviour more generally has remained unexplored. Here, we develop a kin-selection model of altruism performed by men and women for the benefit of their groupmates in a population experiencing intergroup conflict. We find that warfare can promote altruistic, helping behaviours as the additional reproductive opportunities winners obtain in defeated groups decrease harmful competition between kin. Furthermore, we find that sex can be a crucial modulator of altruism, with there being a tendency for the sex that competes more intensely with relatives to behave more altruistically and for the sex that competes more intensely with non-relatives in defeated groups to receive more altruism. In addition, there is also a tendency for the less-dispersing sex to both give and receive more altruism. We discuss implications for our understanding of observed sex differences in cooperation in human societies.