A court in Argentina has granted basic rights to an orangutan who has been in captivity for more than two decades. In a historic decision, the female orangutan will be released to a sanctuary if the zoo where she lives now does not appeal.

Sandra, a 29-year-old orangutan, has been recognized as a "non-human person," according to Reuters. The court deemed that Sandra was unlawfully detained in the Buenos Aires zoo where she lived for 20 years.

She was born in 1986 Germany and was then transferred to Argentina in 1994. Lawyers from the Association of Officials and Lawyers for Animal Rights (AFADA) filed a habeas corpus petition in November. The court ruled that the orangutan deserved the basic rights of a "non-human person."

"This opens the way not only for other Great Apes, but also for other sentient beings which are unfairly and arbitrarily deprived of their liberty in zoos, circuses, water parks and scientific laboratories," AFASA attorney Paul Buompadre told the newspaper La Nacion.

The zoo where she lives declined to make a statement but their head of biology, Adrian Sestelo, said orangutans are calm and solitary animals who only socialize to mate or care for their young. The zoo has 10 days to appeal the decision.

"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," Sestelo said.

The case is not the first one of its kind, according to the BBC. A New York court threw out a case concerning a pet chimpanzee. In that case, the court said the ape was personal property and did not have any rights.

If the zoo does not appeal, Sandra will be sent to a sanctuary in Brazil where she will have limited freedom.