writ of habeas corpus
a document filed as a means of testing the legality of a restraint on a person's liberty, usually imprisonment. The writ commands the officials who have custody of a prisoner to bring the prisoner before the court, so that the court may determine whether the prisoner is being detained lawfully.
Source: Federal Judicial Center