Sheep aren't viewed as the cleverest of creatures, but new research has found they might be a lot more intelligent than previously thought.
Scientists at the University of Cambridge found that Welsh mountain sheep can map their surroundings, and may even be able to plan ahead.
The discovery shows they have the brainpower to equal rodents, monkeys and, in some tests, even humans.
The study was part of wider research into Huntington's Disease.
Professor Jenny Morton from the Department of Pharmacology at the University of Cambridge says the beasts' 'stupid' reputation may be unwarranted.
She told BBC Wales: "Our tests showed they can do what is known as executive decision making.
"We looked at whether they were able to understand rules and got them to do what is known as a choice discrimination task.
"But when we changed the rules, they behaved pretty much as a human in that they got bothered about us changing those rules."
Professor Morton put a flock of Welsh mountain sheep through a series of tests to measure their intelligence.
One saw her using coloured buckets to see how long it would take the sheep to work out they could find food in the same-coloured bucket every time.
The colour of the buckets was then changed, so the sheep had to re-learn the association. They were able to do this in the same amount of time it takes monkeys and rodents in similar tests.
In a more complex task the sheep had to learn where the food was according to coloured shapes and were able to learn the new rules within 32 attempts.
Professor Morton added: "We expected that looking at sheep wouldn't be that helpful but they are actually reasonably similar to humans in many ways.
"They're very good animals and very enthusiastic subjects.
"If you talk to farmers they'll probably tell you that they have a very good spatial memory - they're not as daft as they look."
Her research, which is published in the journal Public Library of Science One, is part of a wider attempt to use sheep as an animal model for examining Huntington's Disease (HD).
The disease, which is genetically inherited, affects muscle co-ordination, often causing involuntary writhing movements called chorea, and it leads to cognitive decline.
It currently affects at least 6,700 people in England and Wales.
Anyone who carries the mutant gene will go on to develop HD, and their child has a 50% chance of inheriting it.
"Sheep have great potential, not only for use as a large animal model of HD, but also for studying cognitive function and the evolution of complex behaviours in normal animals," added Professor Morton.
She has also conducted trials to test the spatial memory of sheep and found they are able to navigate by forming memories of their surrounding environments.
She is now conducting tests to see whether sheep are able to plan ahead.
Previous research at the Babraham Institute in Cambridge has also shown that sheep have the ability to recall human faces and react to different facial expressions.
They can also recognise other sheep by their facial features.