As the infinite monkey theorem has it, a monkey hitting random keys on a typewriter will eventually produce the complete works of Shakespeare. Now it seems that a monkey clicking away with a digital camera will eventually produce portraits of startling beauty.

The pictures here were taken not by a wildlife photographer but by one of a group of crested black macaques in a national park in Indonesia.

Photographer David Slater, 46, was visiting the park when he decided to try to get close to the animals. He teamed up with a local guide and over three days got to know the creatures. "I walked with them for about three days in a row," said Slater. "They befriended us and showed absolutely no aggression – they were just interested in the things I was carrying," he said.

"They aren't known for being particularly clever like chimps, just inquisitive. Despite probably never having any contact with humans before, they didn't seem to feel threatened by our presence."

Slater said the photoshoot that resulted in these pictures took place after he set up a camera on a tripod. He left the equipment for a few moments and when he returned one of the creatures was, well, monkeying around with it.

"They were quite mischievous, jumping all over my equipment. One hit the button. The sound got his attention and he kept pressing it. At first it scared the rest of them away but they soon came back – it was amazing to watch.

"At first there was a lot of grimacing with their teeth showing." But then the animals seemed to settle down.

"He must have taken hundreds of pictures by the time I got my camera back."

And with just a little imagination, you could imagine that some of the monkeys were running through a series of poses.

The crested black macaque is a threatened species that lives in the northeast of the Indonesian island of Sulawesi and smaller neighbouring islands. It spends more than half of its day on the ground foraging for food and socialising and tends to live in groups of between five and 25 animals.

The authenticity of the images was questioned on Twitter but Slater says they are genuine. "They do look strange anyway because of their punk hairdo and their reddish eyes."