Although it has always been assumed that chemical mimicry and camouflage play a major role in the penetration of ant societies by social parasites, this paper provides the first direct evidence for such a mechanism between the larvae of the parasitic butterfly Maculinea rebeli and its ant host Myrmica schencki. In the wild, freshly moulted fourth–instar caterpillars, which have no previous contact with ants, appear to be recognized as ant larvae by foraging Myrmica workers, which return them to their nest brood chambers. Three hypotheses concerning the mechanism controlling this behaviour were tested: (i) the caterpillars produce surface chemicals that allow them to be treated as ant larvae; (ii) mimetic compounds would include hydrocarbons similar to those employed by Myrmica to recognize conspecifics and brood; and (iii) the caterpillar–s secretions would more closely mimic the profile of their main host in the wild, M. schencki, than that of other species of Myrmica. Results of behavioural bioassays and chemical analyses confirmed all three hypotheses, and explained the high degree of host specificity found in this type of highly specialized myrmecophile. Furthermore, although caterpillars biosynthesized many of the recognition pheromones of their host species (chemical mimicry), they later acquired additional hydrocarbons within the ant nest (chemical camouflage), making them near–perfect mimics of their individual host colony–s odour.