In many social species, aggressive conflict between individuals in the same group (intragroup conflict) is often followed by increased allogrooming (when one individual grooms another) involving the protagonists and their relatives. Although conflict between groups (intergroup conflict) is also common, there has been little consideration of its impact on intragroup affiliative behaviour. Moreover, there has been no investigation of whether the different threat posed by different rival groups (for example, neighbours and strangers) influences the level of subsequent affiliative behaviour. Experiments using playbacks to simulate territorial intrusions by green woodhoopoes (Phoeniculus purpureus), reported here, show that intragroup allopreening -- the avian equivalent of allogrooming -- increases significantly in response to strange groups, but not neighbouring groups, and that the increase is due to more allopreening of subordinate helpers by the dominant pair. This is the first experimental evidence for an influence of intergroup conflict on intragroup affiliative behaviour, and lends support to the recent idea that intragroup cooperation should increase most when the intergroup threat is highest.