After training, the sheep chose photos of familiar faces over unfamiliar ones significantly more often than not.
It shows that sheep possess similar face recognition abilities to primates.
Previous studies had shown that sheep could identify other sheep and human handlers that they already knew.
"What we did is ask whether a sheep could learn to recognise someone from a photograph," the study's lead author Prof Jenny Morton said.
"We focused on whether or not an animal was capable of processing a two-dimensional object as a person."
Eight female Welsh Mountain sheep were trained to distinguish the four celebrity faces from pictures of unfamiliar people, using food pellets as a reward.
The ruminants were shown different photos on two computer screens; the sheep made their choice by breaking an infrared beam with their noses to release the treat.
After establishing the animals' ability to recognise the celebrities, researchers set them a new task. They wanted to see whether the farm animals could correctly identify the same celebrities when pictured from different angles.
Again, the animals' performance on this task was significantly above chance.
Finally, the researchers wanted to know if the sheep could recognise their handlers from a photo. Images of their custodians were randomly interspersed in a sequence of unfamiliar faces shown to them on the screens.
On this task too, the sheep didn't disappoint.
The results show that the animals' face-recognition abilities are similar to those of monkeys, apes - and humans.
The researchers say it might be interesting in future to investigate whether sheep can identify different expressions on human faces.
The work might even have implications for learning about neurodegenerative diseases, such as Huntington's and Parkinson's.
The research is published in the Royal Society journal Open Science.
More about: #science