The order means the university holding the chimpanzees will have to respond to the activists' petition in court.
The activists said the court had "implicitly determined" that the two chimpanzees are legal "persons".
However, other experts say the writ may simply be a way for the court to gather more information at a further hearing.
The case concerns two chimpanzees, Hercules and Leo, being held at a research facility at Stony Brook University in New York state.
The Nonhuman Rights Project originally filed a lawsuit on behalf of the chimpanzees in 2013 with a view to having them transferred to a sanctuary in Florida, but in that instance the courts refused to issue a writ.
However, on Monday Judge Barbara Jaffe of New York's state Supreme Court issued the writ, meaning a hearing will now be held on 6 May in which the university's lawyers will have to explain the legal basis of the chimpanzees' detention.
Habeas corpus, which is Latin for "you may have the body", is a writ which traditionally requires a person detained by the authorities to be brought before a court of law so that the legality of the detention may be examined.
"The judge may merely want more information to make a decision on the legal personhood claim, and may have ordered a hearing simply as a vehicle for hearing out both parties in more depth," law professor Richard Cupp told Science magazine.
"It would be quite surprising if the judge intended to make a momentous substantive finding that chimpanzees are legal persons if the judge has not yet heard the other side's arguments," he went on.
David Bookstaver, a spokesman for the New York State Courts, also rejected the activists' claim that the judge had conferred personhood on the chimps.
The judge had merely signed an order to show "cause", he said, and the hearing in May would determine next steps.
The Nonhuman Rights Project says the ruling is the first of its kind and can be used as a precedent in future litigation.
The group argues that New York law does not limit legal personhood to human beings.
The state has previously conferred legal personhood status on domestic animals who are the beneficiaries of trusts, the campaign says, as well as extending rights to non-human entities such as corporations.
A judge in New York has issued a writ of habeas corpus in a case brought by animal rights activists on behalf of two chimpanzees.