Gorillas have a vast array of gestures with which they communicate, scientists have discovered.

From performing a pirouette to waving their arms about, gorillas use more than 100 different movements to communicate - more than any other mammal.

Gorillas may be our closest relatives, but to a human onlooker some of the actions seem bizarre.

Whereas it is unsurprising that a touch on the arm can be a signal to calm down or an invitation to have a cuddle, it would not be so easy to guess that a pirouette would be a warning that another gorilla should stop a particular action.

Researchers at the University of St Andrews have found that gorillas use at least 102 gestures to communicate with each other.

From beating their chests to putting objects on their heads, shaking their arms and even bouncing on all fours, the animals were found to carry out a wide variety of actions and signals to communicate with other members of their groups.

They vary from a fairly simple rocking movement to a complex sounding signal dubbed by the scientists as "disco arms shake".

Professor Richard Byrne, a psychiatrist involved in the research, said it was hard to work out what the gestures meant. He said: "We don't really know what the animals are thinking. Often they have more than one meaning, depending on the context."

Prof Byrne said he was surprised by the results of the research, because it showed that the gorillas did not learn gestures from each other, as had been expected, but carried them out instinctively.

"Everyone had assumed different groups of gorillas had been learning different gestures," he said. "But that's not what we found. As we went to more sites, the more we found the same gestures being used."

He said in one sense this was similar to dogs all using the same gestures to communicate, such as wagging their tails. But it was remarkable that gorillas had such a large repertoire.

"They seem to be naturally equipped with a pretty elaborate system of communication," he said.

Older juvenile gorillas used the most gestures, particularly when playing, and adults used the least.

The study found that ape gestures were carried out with close attention to the potential audience: silent ones were only given when other apes could see them. Some gestures, such as "disco arms shake" were only ever seen being directed towards a human.

Other signals, such as swinging an arm while holding an object, and tapping another gorilla, were particularly common and seen in all groups of gorillas.

The scientists studied the great apes at three captive facilities, as well as one group in the wild in Africa. They spent six hours a day watching the animals, for up to seven weeks at each site, trying to pick up signs or gestures.

Prof Byrne said he hoped that the research might help to explain how human language evolved.

"There has always been speculation that the origins of human language might lie in gesture, an idea supported by the close proximity of the brain areas involved in language and gesture," he said. "Many researchers have therefore studied the gestural communication of the great apes for clues to the evolutionary origins of human gesture."

The researchers' work also shed light on the ability of gorillas to copy the actions of humans.

Several studies have shown great apes are capable of mimicking gestures. However, the scientists found that copies of human actions were actually gestures they were already able to do themselves.

"They matched the demonstrated actions pretty well, but not exactly," said Prof Byrne.

"So we think that, just as in the case of communicative gestures, the fact that apes have a huge repertoire of actions can explain how they imitate human demonstrations and why their copies are usually inexact: they are 're-using' actions from their own repertoire, not learning new ones."

The research was carried out by the School of Psychology at the University of St Andrews and the Max Planck Institute for Evolutionary Anthropology, Leipzig.