Inter- and intraspecific competition was investigated in ants of the myrmicine genus leptothorax in a deciduous woodland near Würzburg, Germany. The most common species, A. (Myrafant) nylanderi, lives in rotting pine, oak, and elder sticks and may locally reach densities of 10 nests per m2. In the studied sites, only a small fraction of colonies were polydomous, i.e. single colonies typically did not inhabit several nest sites. The home ranges of nylanderi colonies overlap the ranges of other conspecific colonies and colonies of other species, especially L. (s.str.) gredleri. Foragers from different colonies encountering one another in the field back off without exhibiting strong aggression, suggesting that colonies do not defend absolute foraging territories. In laboratory experiments, the frequency and severity of agonistic interactions among workers from different colonies, all living in pine sticks, increased significantly with the distance between their nests. Workers from colonies nesting in different types of wood exhibited significantly more aggression. Experiments in which we transferred colonies from pine sticks into artificial pine or oak nests corroborate the hypothesis that nesting material strongly influences colony odour in L. nylanderi. The evolutionary significance of this apparent dear-enemy phenomenon is discussed.