Under the deal, the photographer whose camera was used to take the photos agreed to donate 25% of any future revenue from the images to charities dedicated to protecting crested macaques in Indonesia.

Attorneys have announced a settlement in a lawsuit over who owns the copyright to selfie photographs taken by a monkey before a federal appeals court could answer the novel legal question.

Under the deal, the photographer whose camera was used to take the photos agreed to donate 25 % of any future revenue from the images to charities dedicated to protecting crested macaques in Indonesia, lawyers for an animal-rights group said on Monday.

Attorneys for the group and the photographer, David Slater, asked the San Francisco-based 9th US Circuit Court of Appeals to dismiss the case and throw out a lower court decision that said animals cannot own copyrights.

Andrew J Dhuey, an attorney for Mr. Slater, declined to comment on how much money the photos have generated or whether Mr. Slater would keep all of the remaining 75 % of future revenue.

There was no immediate ruling from the 9th Circuit. The People for the Ethical Treatment of Animals sued on behalf of the macaque monkey in 2015, seeking financial control of the photographs for the benefit of the monkey named Naruto that snapped the photos with Mr. Slater’s camera.

“PETA and David Slater agree that this case raises important, cutting-edge issues about expanding legal rights for non-human animals, a goal that they both support, and they will continue their respective work to achieve this goal,” Mr. Slater and PETA said in a joint statement.

Lawyers for Mr. Slater argued that his company, Wildlife Personalities Ltd., owns worldwide commercial rights to the photos, including a now-famous selfie of the monkey’s toothy grin.

The photos were taken during a 2011 trip to Sulawesi, Indonesia, with an unattended camera owned by Mr. Slater.

US District Judge William Orrick said in a ruling in favor of Mr. Slater last year that “while Congress and the President can extend the protection of law to animals as well as humans, there is no indication that they did so in the Copyright Act.” The 9th Circuit was considering PETA’s appeal.

The lawyers notified the appeals court on Aug. 4 that they were nearing a settlement and asked the judges not to rule. A three-judge panel of the 9th Circuit heard oral arguments in the case in July.