Navigation with respect to moving goals represents a useful ability in the everyday life of animals. We have developed a novel behavioral paradigm, "enemy avoidance task", in which a laboratory rat (subject) was trained to avoid another rat (enemy), while searching for small pasta pellets dispensed onto an experimental arena. Whenever the distance between the two animals was smaller than 25 cm, the subject was given a mild electric footshock. The results have shown that rats are capable of avoiding another rat while exploring an environment. Therefore, the enemy avoidance task can be used in electrophysiological, lesion or neuropharmacological studies exploring neuronal substrate coding for egocentric and allocentric positions of an observed animal.