A selfie of a monkey has caused legal issues over who owns the rights to the picture.

Monkey

Monkey

David Slater was photographing the crested macaques in Indonesia when one of the monkeys came up to the camera and pressed a button taking a perfect selfie.

However, animal rights group People for the Ethical Treatment of Animals (PETA) sued on behalf of the macaque back in 2015, claiming the monkey owned the copyright of the picture.

Now, after a two-year legal battle, David has agreed to donate 25 percent of any future revenue of the images to charities dedicated to protecting the monkeys, MailOnline reports.

Lawyers for the group and the photographer asked the San Francisco-based 9th US Circuit Court of Appeals to drop the case claiming that animals cannot own copyright.