"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 co-author Dr Elodie Briefer, now based at ETH Zurich.
Before each learning session, some of the goats had the opportunity to watch another goat to demonstrate the task.
Dr Briefer added: "We found that those without a demonstrator were just as fast at learning as those that had seen demonstrations. This shows that goats prefer to learn on their own rather than by watching others."
This is the first time that scientists have investigated how goats learn complex physical cognition tasks, which could explain why they are so adaptable to harsh environments and good at foraging for plants in the wild, for example.
Co-author Dr Alan McElligott from Queen Mary's School of Biological and Chemical Sciences, commented: "Our results challenge the common misconception that goats aren't intelligent animals - they have the ability to learn complex tasks and remember them for a long time.
"This could explain why they are so successful in colonising new environments, though we would need to perform a similar study with wild goats to be sure."
The research was supported through a Swiss Federal Veterinary Office grant and Swiss National Science Foundation fellowship. The data was collected at Buttercups Sanctuary for Goats in Kent.