Cha-cha-ing chimps have a sense of rhythm and like to dance to music, new research suggests.

Primates clapped hands, tapped feet and swayed along when played bursts of piano as part of a study by scientists in Japan.

Until now, dancing has been considered an almost uniquely human trait.

But all seven chimpanzees being monitored boogied along as they were exposed to the tunes – a finding that could help shed light on how our own prehistoric ancestors came to enjoy moving to melodies.

The study – carried out by scientists at Kyoto University – exposed the apes to six two-minute piano compositions for six days.

Although none had been taught to groove and received no rewards for doing so, they still broke out into spontaneous movement when the tunes started.

“Chimpanzees dance to some extent in the same way as humans,” lead researcher Dr Yuko Hattori said.

Males were the most likely to respond and were both more vocal and more mobile for longer durations compared with their female counterparts.

“Given that humans do not have such a sex difference in musical ability, higher sensitivity to sound in male chimpanzees may have been acquired after chimpanzees diverged from the common ancestor shared with humans,” the researchers wrote in the journal Proceedings of the National Academy of Sciences.

“This may also be associated with their patriarchal society, where male chimpanzees often collaborate to protect their territory and group members.”

And the researchers said the findings hinted that our own love for dancing was deeply rooted and primal, rather than something that had been learned.

“In humans, listening to music induces rhythmic movement, suggesting a close connection between the auditory and motor areas in the brain,” the study says.

“These results suggest that prerequisites for music and dance are deeply rooted and existed in the common ancestor shared by humans and chimpanzees, approximately six million years ago.”