More than a year after the starting fight for legal personhood for the research chimpanzees Hercules and Leo, the apes and their lawyers got their day in court. At a hearing in Manhattan on Wednesday, a judge heard arguments in the landmark lawsuit against Stony Brook University, with a decision expected later this summer. At stake: the question of whether only human beings deserve human rights.

A decision could set a precedent for challenging, under human law, the captivity of other chimpanzees—and perhaps other species. It's a radical notion, and many legal experts doubted whether the lawsuit, one of several filed late in 2013 by the Nonhuman Rights Project, would ever reach court.

But Justice Barbara Jaffe decided to consider the arguments. "The law evolves according to new discoveries and social mores," she said while presiding over the hearing. "Isn't it incumbent on judiciaries to at least consider whether a class of beings may be granted a right?"

Jaffe posed that question to New York assistant attorney general Christopher Coulston, who represented the university, where the two chimps are housed. Coulston had argued that Jaffe was bound by the previous decisions of two appellate courts, which had ruled that other Nonhuman Rights Project chimps didn't qualify for habeas corpus, the legal principle that protects people from illegal imprisonment.

Both those decisions are controversial. In one, judges decided that habeas corpus didn't apply because the chimp would be transferred from one form of captivity to another—in this case, a sanctuary. But illegally-held human prisoners have been released to mental hospitals, and juveniles into the care of guardians.

In the other appeals court decision, judges declared that chimps are not legal persons because they can't fulfill duties to human society. But that rationale arguably denies personhood to young children and mentally incapacitated individuals, as several high-profile legal scholars, including Constitutional law expert Laurence Tribe, pointed out. He filed a brief on behalf of the Nonhuman Rights Project, saying the court "reached its conclusion on the basis of a fundamentally flawed definition of legal personhood."

In fact, Nonhuman Rights Project attorney Steven Wise argued, New York law only requires judges to follow appeals court decisions involving settled legal principles—which animal personhood is not. That set the stage for the pivotal question: What is the basis of legal personhood? Wise said it's rooted in the tremendous value placed by American society and New York law on liberty, which is synonymous with autonomy. "The purpose of the writ of habeas corpus isn't to protect a human being," he said. "It's to protect autonomy."

By that standard, Wise said, chimpanzees qualify. "Chimps are autonomous and self-determined beings. They are not governed by instinct," he said. "They are self-conscious. They have language, they have mathematics, they have material and social culture. They are the kinds of beings who can remember the past and plan for the future." In a human, argued Wise, those capacities are grounds for the right to be free.

Coulston marshalled an argument elsewhere made by Richard Posner, a legal theorist and federal appeals court judge who has written that legal rights and personhood were designed with only humans in mind. "Those rights evolved in relation to human interests," Coulston said. "I worry about the diminishment of those rights in some way if we expand them beyond human beings."

The cognitive capacities of chimpanzees have been compared to 5-year-old humans, said Coulston; how would the legal system handle animals with minds comparable to a 3-year-old, or a 1-year-old? "This becomes a question of where we're going," he said, with chimp personhood opening the floodgates to lawsuits on behalf of animals in zoos or on farms, or even pets. "The great writ is for human beings," he said, "and I think it should stay there."

Wise countered by saying that denying freedom to an autonomous being is itself a diminishment; it could even come back to bite us, serving as rationale for limiting human freedom. He described the slippery slope as a separate issue. Freedom—or at least sanctuary—for Hercules and Leo is something to debate on its own merits, just as rights for any potentially deserving human should be considered without regard for social inconvenience.

It is true, though, that success could lead to personhood claims on behalf of other chimps, as well as other great apes, orcas and also elephants, for whom the Nonhuman Rights Project is now preparing a case. More than a third of Americans now support rights for animals.

Win or lose, Wise said at a press conference following the trial, the hearing itself was a victory. "Many human beings have these kinds of hearings," he said. Chimpanzees "are now being treated like all the other autonomous beings of this world." Whether they'll continue to get that treatment will be up to Justice Jaffe. Or, more likely, whoever hears the almost inevitable appeal of her decision.