1. Background cues may affect the perception and processing of sensory stimuli used by species to detect other organisms. These additional environmental cues change the effectiveness of behavioural responses and eventually influence species interactions. Ants make use of an advanced sensing system to detect intruders, but little is known how cues of the heterogeneous soil substrate influence their behavioural response. 2. Here, the aggressive response of red wood ants towards the beetle Notothecta flavipes, a parasitic nest associate, was tested against a background of two types of nest material present in the heterogeneous nests of wood ants, organic thatch (upper part of the nest) and sand (lower part of the nest). I used plaster as control. In addition, the three types of substrate were conditioned with or without chemical nest recognition cues of the host ant. 3. Ant aggression was strongly affected by the type of background substrate. Compared to a control background of plaster, the likelihood of ant aggression was 2.8 times and 1.7 times lower against a background of organic thatch and sand, respectively. As visual cues were eliminated in the aggression tests, the reduced aggression levels may be caused by the interference of olfactory scents emitted by the substrate. By contrast, an increase of biting attempts was recorded when the background substrate was conditioned with chemical cues of the ants, suggesting that ants defend familiar smelling terrain more fiercely. 4. Overall, these results suggest that the soil background may have complex and spatially variable effects on species interactions in heterogeneous patches.