An animal rights group has been granted a court hearing in which it will argue that two chimpanzees who live at a New York state university cannot be held captive because they are autonomous, intelligent creatures.

New York State Supreme Court Justice Barbara Jaffe in Manhattan issued an order late Monday, called a writ of habeas corpus, requiring the State University of New York at Stony Brook on Long Island to defend its right in court to keep the primates, Hercules and Leo. A writ of habeas corpus requires a person to be released from unlawful imprisonment.

In what it said was the first case of its kind in the world, the Nonhuman Rights Project claims that because chimpanzees are autonomous, intelligent creatures, their captivity amounts to unlawful imprisonment under the law. They want the pair of chimps, who are used in research on physical movement at the university, to be sent to a sanctuary in Florida.