NEW YORK (Reuters) - The quest to free the chimpanzees Tommy and Kiko has reached the end of the line.

New York state’s highest court on Tuesday rejected an appeal by the Nonhuman Rights Project seeking to move the animals to a sanctuary and end their confinement in cages by private owners.

By a 5-0 vote, the Court of Appeals let stand a June 2017 ruling by an intermediate state appeals court in Manhattan that chimpanzees are not legal persons, and that it is up to legislators to decide what rights animals deserve.

The Nonhuman Rights Project believes chimpanzees are, like humans, entitled to bodily liberty, and it has for several years sought to persuade courts to grant legal rights to the animals.

In a concurring opinion on Tuesday, Court of Appeals Judge Eugene Fahey said the issue of whether animals are entitled to writs of habeas corpus to obtain freedom from detention touches on a “deep dilemma of ethics and policy” that must be addressed.

Fahey said chimpanzees share at least 96 percent of their DNA with humans, and eminent primatologists have said the animals have advanced cognitive skills including the abilities to recognize themselves, remember, plan, imitate, exercise self-control, and display compassion and humor.

“While it may be arguable that a chimpanzee is not a ‘person,’ there is no doubt that it is not merely a thing,” Fahey wrote.

Steven Wise, a lawyer for the Nonhuman Rights Project, said his group planned another lawsuit in a couple of months on behalf of a different animal he would not identify.

Fahey’s opinion “could be a historical turning point in the struggle to obtain legal rights for nonhuman animals in the United States,” Wise said in an interview.

The group also sued unsuccessfully to win freedom for two chimpanzees held by the State University of New York at Stony Brook. They moved after the school stopped using them for research.

The cases are In re: Nonhuman Rights Project Inc on behalf of Tommy v Lavery et al, and In re: Nonhuman Rights Project Inc on behalf of Kiko v Presti et al, New York Court of Appeals, Motion No. 2018-268.