Akira stands up and sways about. Pal is big on clapping. Ai is into tapping her foot, while Gon bangs and slaps the walls.

Not the latest teen band sensation, but a spectacle far more impressive: the moves of a group of chimpanzees that scientists believe shed light on the prehistoric origins of human dancing.

The researchers in Kyoto filmed the chimps performing the movements in a music booth attached to their enclosure where the apes could go to rock out to piano sounds played in the room.

None of the chimps had been taught to groove, and they received no rewards for doing so in the study, but regardless they broke out into spontaneous bodily expression when the beats started.

“Chimpanzees dance to some extent in the same way as humans,” said Yuko Hattori, a researcher at Kyoto University who studied the dancing chimps. Most of the apes swayed their bodies, though claps and foot taps featured too, primarily among the females.

While dance has a rich and ancient history in humans, it is considered all but absent in non-human primates. The most similar behaviour seen in the wild are chimpanzees’ “rain dances” and waterfall displays. This month, researchers at Warwick University reported chimps in Saint Louis Zoological Park in Missouri moving in what looked uncannily like a conga, but the apes had no musical accompaniment.

Hattori and her colleagues recorded how seven chimpanzees – three males and four females – responded when they were played short recordings of strident piano rhythms. The booth was reached by a tunnel connected to the chimps’ normal living quarters, which adjoined an outside space.

All of the apes responded to the two-minute recordings of piano sounds. Six stood up and swayed about, five banged or knocked on the booth’s panels, three clapped along, while one – a female called Ai – spent half the time tapping her foot. The displays lasted between a couple of seconds and a minute each, Hattori told the Guardian.

Males tended to dance and hoot a lot more than the females. One 39-year-old male, Akira, spent half his time dancing when the piano was playing. Another male, Ayumu, came second in the dance-off, spending about a third of his time jigging about in one way or another. Next was Gon who spent about 10% of his time moving to the sounds.

The females, meanwhile, seemed far less enthusiastic. All danced for less than 10% of the time the music was played. One female, Chloe, had only one move – the “hanging sway”, as the scientists called it – but she apparently preferred not to bother at all.

Having identified Akira as the keenest mover in the troop, further studies focused on him. When stood on two legs, his moves seemed to track the tempo, which ranged from 83 to 150 beats per minute, though he also moved to random beats. When the music was shut down, he would wander back to the other apes, implying that it was the dancing, and not the booth alone, that he came for.

According to a report in the Proceedings of the National Academy of Sciences, the rhythmic moves suggest that the urge to dance has a prehuman origin, reaching at least as far back as the primate from which all humans and chimps descended.

“The biological foundation for dancing is deeply rooted and had already existed in the common ancestor between humans and chimpanzees approximately 6m years ago,” Hattori said.

Chimp dancing may be a mostly male pursuit because in their patriarchal society, males more than females use sound to communicate and collaborate with other males to protect territory and group members, the scientists say.