(CNN)The case of the world's most litigious selfie has come to a close.
The People for the Ethical Treatment of Animals (PETA) and photographer David Slater have reached a settlement in a dispute over who owns the rights to a selfie of a monkey.
The photograph was taken in 2011 by a 7-year-old crested macaque named Naruto.
Naruto took Slater's camera while he was on assignment in Indonesia and snapped a photograph of himself with it, court documents say.
The animal rights organization had argued that by republishing the photo Naturo's rights were being infringed.
Under the agreement, Slater will donate 25% of any future revenue derived from using or selling the monkey selfie to charities that protect the crested macaques' habitat in Indonesia, according to a joint statement published on PETA's website.
"PETA and David Slater agree that this case raises important, cutting-edge issues about expanding legal rights for nonhuman animals, a goal that they both support, and they will continue their respective work to achieve this goal," the two parties said.
The dispute over the photo's ownership came about after it was posted on Wikipedia's free-to-use website, after which Slater asked that it be taken down.
Wikipedia argued the photo is uncopyrightable because an animal took it, and animals can't own copyrights, according to CNN legal analyst Danny Cevallos.
The image and the legal case attracted international attention, raising complex legal questions about copyright and art when it comes to animals.
PETA sued in 2015 arguing that publishing and selling the photographs that Naruto took infringed on his rights under the Copyright Act.
The defendants argued that, as a monkey, Naruto couldn't own a copyright. A court agreed with that argument, according to a January 2016 provisional ruling, but PETA appealed the decision.