NEW YORK — Two chimpanzees that were caged at a trailer lot and at a primate sanctuary don’t have the legal rights of people in New York, an appeals court said Thursday.

Nonhuman Rights Project attorney Steven Wise had argued to the appeals court in March that adult male chimps Tommy and Kiko should be granted a writ of habeas corpus, which for people relates to whether someone is being unlawfully detained or imprisoned and should be taken to see a judge.

Chimpanzees, which can walk upright and use sticks and stones as tools, are considered to be the closest living relatives of humans. Some have been taught to speak simple human sign language.

But the state Supreme Court’s appellate division, in a ruling that affirmed a lower court’s decision, said there was no legal precedent for chimpanzees being considered people and their cognitive capabilities didn’t mean they could be held legally accountable for their actions.