Sheep do not behave "like sheep" in the way most people imagine, research has suggested.
When they follow the flock, they are not so much copying each other as acting on their own out of a sense of survival.
Scientists tested the "selfish herd" hypothesis by strapping GPS satellite tracking devices to the backs of animals being rounded up by a sheep dog.
They confirmed that the sheep's herding behaviour was governed by an individual drive to escape danger.
A sheep at the centre of a herd is less likely to be eaten by a predator than one on the outside.
"We were able to track the movements of the sheep and the dog that pursued them on a second-by-second basis simultaneously," said lead researcher Dr Andrew King, from the Royal Veterinary College, University of London.
"In each case, we found that the sheep exhibit a strong attraction towards the centre of the flock as the dog approaches."
While many experts support the "selfish herd" explanation for why animals group together, proving the theory has not been easy. It means tracking the concerted movements of many individual animals at once, and predicting when they are going to be attacked.
The findings, published in the journal Current Biology, suggest that individual sheep under threat continuously move towards the centre of the flock. The flock as a whole, meanwhile, moves away from the threat.
The study may be useful to other scientists investigating Huntington's disease. Sheep are a popular model for the devastating human condition, which causes personality changes and uncontrollable movements.