Sandra, a 29-year-old orangutan at Buenos Aires's zoo. (Juan Mabromata/AFP/Getty Images)

In recent months, animal rights advocacy groups have worked to free primates from captivity by representing them in court, fighting for the animals' rights to be recognized as non-human "people."

In the United States, chimpanzees are losing trials left and right. But an Argentinian orangutan has just won her habeas corpus case.

Habeas corpus petitions are typically filed when a human is unrightfully detained or imprisoned. But animal rights groups say that intelligent, non-human primates (and perhaps even other animals) should be given the basic rights of personhood as well.

The Association of Officials and Lawyers for Animal Rights argued that Sandra, a 29-year-old orangutan who's lived in Argentinian zoos for most of her life, is too intelligent to be considered an object. And unlike in the United States, the court actually agreed.

The Buenos Aires zoo has 10 days to file an appeal. If they don't, it's not as if Sandra will be let out into the street or sent into the wild -- she may have the basic rights of personhood, but no one is saying she can live as a human. And after a life in captivity, she probably wouldn't be able to survive in the wild.

Instead, Sandra's "freedom" will be in a sanctuary, where she can live with others of her species and avoid gawking humans.

Sandra's zookeepers argue that she's well cared for.

“When you don’t know the biology of a species, to unjustifiably claim it suffers abuse, is stressed or depressed, is to make one of man’s most common mistakes, which is to humanize animal behavior,” The zoo’s head of biology Adrian Sestelo told the media.

It's interesting that this win came through for an orangutan and not a chimpanzee. While both of these great apes are highly intelligent, chimps are very social while orangutans are generally loners. When Tommy the Chimp's lawyers argued that he should be removed from captivity, they had this in their favor -- he was being kept alone in a backyard enclosure, which isn't the way chimps are meant to live.

But if Sandra wasn't being neglected or mistreated by her zookeepers, the push for her personhood reveals a more generalized anti-zoo sentiment -- and her win may open a floodgate of similar cases from her lawyers on behalf on other sentient beings.