SAN FRANCISCO — Attorneys announced a settlement Monday 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 percent of any future revenue from the images to charities dedicated to protecting crested macaques in Indonesia, lawyers for an animal-rights group said.

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

Get top headlines in your inbox every afternoon.

Sign up for the free PM Report newsletter.

Andrew Dhuey, an attorney for Slater, declined to comment on how much money the photos have generated or whether Slater would keep all of the remaining 75 percent 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 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,” Slater and PETA said in a joint statement.

Lawyers for 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 Slater.

U.S. District Judge William Orrick said in a ruling in favor of 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.