(CNN)The intelligence of pigs has long been renowned -- and scientists in the US have now found that they are clever enough to be able to use computer joysticks.
Researchers from Purdue University in Indiana said they were able to train four pigs to carry out a "joystick operated video game task" to get treats.
The pigs' success rate in the task was described by researchers as "remarkable, and indicative of their behavioral and cognitive flexibility."
The animals -- a pair of two-year-old Panepinto micro pigs and two three-month-old Yorkshire pigs -- were trained to manipulate a joystick in order to control a cursor on a computer monitor, researchers said in a study published Thursday.
That cursor could be used to hit three targets -- of varying difficulty -- on the screen. When the target was hit, an automatic pellet dispenser released the food.
Ahead of the experiment, the scientists from the university's Center for Animal Welfare Science trained the pigs until they learned the behavior, using voice commands, mock joysticks, and manually dispensed treats.
The animals had to approach a computer, which had "walls" -- or thick blue digital lines -- scattered around the screen.
They then had to select one of the "walls" with the cursor to get a treat. As the pigs' accuracy improved, the number of "walls" reduced to two, and then to one, becoming more difficult.
The Panepinto pigs, Ebony and Ivory, both performed well -- 84% success rate -- when presented with three-wall targets.
But a skill gap appeared between the two pigs as the number of targets reduced, with Ivory able to hit one-wall targets 76% of the time, versus Ebony's 34%.
Meanwhile, Yorkshire pigs Hamlet and Omelet managed to complete the task "above chance" when presented with two walls or a single wall on screen, but not when presented with three walls.
The researchers determined "above chance" to be over and above what targets the pigs could have been expected to get right, at random.
The pigs spent between three and four months taking part in the experiment.
'Impressive learning abilities'
The paper's authors, Candace C. Croney, professor of animal behavior and well-being and director at the university's Center for Animal Welfare Science, and Sarah T. Boysen, a senior researcher at the university, said the experiment suggested the animals had an intelligent understanding of the task.
"The video task acquisition required conceptual understanding of the task, as well as skilled motor performance," they said in the paper.
Speaking to CNN, Croney said she hoped the paper would inspire further research into the cognitive abilities of pigs.
"It would be nice for people to realize how unique pigs are, and how much more mentally sophisticated they may be than we previously recognized," she said.
She hoped research would help people to understand how to better "enrich" the lives of the animals.
Commenting on the significance of the findings, Christian Nawroth, who was not involved in the study and is a researcher at the Leibniz Institute for Farm Animal Biology in Germany, said the paper demonstrated "the impressive learning abilities of pigs."
"We already know that pigs are good problem-solvers, but the ability to use a joystick to navigate a cursor on a screen is certainly something that has not been on the list of any farm animal so far," he told CNN, adding that the task the pigs were given was "not an easy one to solve."
"We still underestimate the smarts of pigs and farm animals in general. As this avenue of research, farm animal cognition, is taking off steam, we will likely see more research on more sophisticated learning and cognitive skills of farm animals over the next years," he added.
The results were published in the journal Frontiers in Psychology.