Habeas corpus is the common law's remedy against unlawful imprisonment. On application, a court commands whoever holds a person — warden, minister, hospital, immigration officer — to produce the detainee and prove the detention lawful. If the justification fails, release follows immediately. The writ examines the legality of detention, not guilt or innocence.
Centuries old and repeatedly fortified by statute, it remains the tradition's emblem of liberty: fast, available to anyone detained by anyone, and jealously guarded by courts against attempts to exclude it. Its gravest tests come in emergencies, when governments claim detention powers beyond judicial scrutiny.
Section 10(c) of the Charter guarantees the right to habeas corpus, and the Supreme Court has extended it inside prisons: a transfer to harsher confinement is itself a detention the state must justify (May v Ferndale, Khela).