Chimpanzees are not legal persons who have a right to be free, a New York state appeals court said in a ruling that denied a request to move two captive apes to a sanctuary.

The unanimous decision on Thursday was another setback for the Nonhuman Rights Project, a group that for several years has sought to persuade New York courts to grant writs of habeas corpus to chimpanzees.

Former circus performer Tommy in a cage at a trailer lot in Gloversville, New York. Credit:AP

A court that agreed would be allowing the animals to challenge the legality of their "detention" - as human prisoners can do - and would also be acknowledging that the apes are not things but rather are legal persons entitled to bodily liberty.

At the centre of the case are Tommy and Kiko, chimpanzees that the Nonhuman Rights Project says are kept in cages by private owners in New York.