The ruling comes a month after a local animal rights group filed a habeas corpus writ in favor of “Sandra.”
Lawyers who represented the ape say the 29-year-old orangutan is expected to be transferred to a sanctuary soon to enjoy more freedom.
The Dec. 18 ruling was published Monday by the official judicial news agency.
It says “a Great Ape has rights, including freedom and avoiding suffering from being in captivity.”
It also says that the animal should enjoy a more adequate habitat.
Andres Gil Dominguez represented the orangutan.
He hailed the ruling Monday, calling it unprecedented.