Insects process and learn information flexibly to adapt to their environment. The honeybee Apis mellifera constitutes a traditional model for studying learning and memory at behavioural, cellular and molecular levels. Earlier studies focused on elementary associative and non-associative forms of learning determined by either olfactory conditioning of the proboscis extension reflex or the learning of visual stimuli in an operant context. However, research has indicated that bees are capable of cognitive performances that were thought to occur only in some vertebrate species. For example, honeybees can interpolate visual information, exhibit associative recall, categorize visual information and learn contextual information. Here we show that honeybees can form 'sameness' and 'difference' concepts. They learn to solve 'delayed matching-to-sample' tasks, in which they are required to respond to a matching stimulus, and 'delayed non-matching-to-sample' tasks, in which they are required to respond to a different stimulus; they can also transfer the learned rules to new stimuli of the same or a different sensory modality. Thus, not only can bees learn specific objects and their physical parameters, but they can also master abstract inter-relationships, such as sameness and difference.