Never judge a goat by its looks.

According to a new study published in the journal Frontiers in Zoology, goats have an impressive IQ. Researchers noticed this after teaching them a specific task and observing them learning it within four attempts. Not only that, the goats remembered the task 10 months later, suggesting an impressive long-term memory.

"Our results challenge the common misconception that goats aren't intelligent animals," Alan McElligott, study co-author from Queen Mary University of London, said in a statement. "They have the ability to learn complex tasks and remember them for a long time."

The researchers trained goats to remove food from a box by pulling a lever with their mouth and then lifting the lever to collect the treat. A group of 12 goats were chosen to master the task. Three were eliminated after they tried to take short cuts to pry open the box. The nine that remained all completed the task within four tries. Ten months later, researchers tested the same nine goats to see whether they remembered how to retrieve the treat from the box. All were able to complete the task in less than a minute.

"The speed at which the goats completed the task at 10 months compared to how long it took them to learn indicates excellent long-term memory," said Dr. Elodie Briefer, study co-author.

The fact that the goats completed complex physical cognition tasks may explain why they are able to adapt to harsh environments, forage for food and live in complex social groups in the wild. They also have a long lifespan and good memories.

While the goats excelled at the box puzzle, their learning had limits. When non-trained goats observed trained goats retrieve the food from the box, they were not able to figure out the puzzle themselves. This may mean that goats prefer to learn on their own or they do not possess the ability to learn from watching others.

Goats belong to a diverse group of mammals called ungulates which include barn animals like cows and sheep but also dolphins, whales and elephants. The latest study, which is the first to study how goats learn complex physical cognition tasks, suggests goats may one of the smarter species in the group.