The aim of this paper is to test the relative contribution of allospecific workers and the queen on species recognition in ants by means of both behavioural and chemical analyses. Workers of two ant species, Manica rubida (Myrmicinae) and Formica selysi (Formicinae), were reared in homospecific groups (without queen) or in artificial heterospecific groups (mixed worker groups and mixed queen/worker groups), created 5 h after emergence. In mixed worker groups, individuals of both species recognize conspecific and allospecific workers even if unfamiliar. When reared with an allospecific queen, individuals retained their ability for conspecific recognition, but it appeared that F. selysi individuals performed better than M. rubida in recognizing unfamiliar conspecifics reared in control groups. However, this rearing scheme did not permit the tolerance of unfamiliar allospecifics. The chemical results indicate that when individuals are reared in mixed worker groups they acquire larger amounts of allospecific cuticular hydrocarbons than when reared in mixed queen/worker groups. While the former recognize unfamiliar allospecific workers, the latter did not recognize unfamiliar allospecific workers in spite of the acquisition of small amounts of allospecific cues. In addition, reared with allospecific workers, queens acquire allospecific hydrocarbons, but less amounts than workers. These experiments therefore show that the individuals recognize the allospecific cues borne on each individual's body surface.