Story highlights An animal rights group files a writ asking for freedom for Argentine orangutan Sandra

Sandra had been living at the Buenos Aires Zoo for 20 years

A court rules that Sandra is a "nonhuman being" with rights to freedom and "no harm"

The zoo has up to two weeks to appeal the ruling

(CNN Espanol) In a world first, a court in Argentina issued a historic and unprecedented ruling that favors the rights of an orangutan held in captivity. Sandra the orangutan was granted a legal action so she may be transferred to a habitat in keeping with her development.

Argentina's Association of Professional Lawyers for Animal Rights filed a writ of habeas corpus, a resource to avoid arbitrary arrests, on Sandra's behalf. Once the release and transfer order is issued, the orangutan would be taken to a sanctuary in Brazil, where she would live under partial or controlled freedom.

Sandra, who has been living in captivity for the past 20 years at the Buenos Aires Zoo, was considered a "nonhuman being" and she was granted basic rights, such as life, freedom and a premise of "no harm" either physically or psychologically.

Argentina's Federal Chamber of Criminal Cassation ruled the primate is a subject of law, "a nonhuman being that has certain rights, and can enforce them through legal procedure," according to Andrés Gil Domínguez, Sandra's attorney.

"This is an unprecedented ruling, the first ruling worldwide," said the lawyer.

Read More