Habeas corpus is a legal procedure and fundamental safeguard against unlawful detention or imprisonment. It is a writ-meaning a court order-that requires a person or authority holding someone in custody (such as a prison official) to bring the detainee before a court to determine whether their detention is lawful. If the custodian cannot justify the detention with proper legal authority, the court must order the prisoner's release
. The term "habeas corpus" is Latin for "you shall have the body," reflecting the requirement that the detained individual be physically brought before the court. The writ serves as a crucial check on arbitrary or illegal imprisonment by ensuring judicial review of the reasons for detention, rather than deciding guilt or innocence
. Habeas corpus can be petitioned by the detainee or by another person on their behalf, especially if the detainee is held incommunicado. It is a flexible remedy used in various contexts, including criminal cases, immigration detention, and military custody, to challenge the legality of confinement or related procedural issues such as bail, jurisdiction, or extradition
. Historically, habeas corpus originated in English common law and was formalized to prevent arbitrary state detention. It remains a cornerstone of legal systems that protect individual liberty, particularly in Anglo-American law. While some countries have similar protections under different names, habeas corpus is recognized as a fundamental right in the United States and other common law jurisdictions
. In summary, habeas corpus is a judicial order that protects individuals from illegal imprisonment by requiring authorities to justify the detention before a court, thereby safeguarding personal freedom and due process rights