# Habeas corpus

Habeas corpus (/ˈheɪbiəs ˈkɔːrpəs/ ; from Medieval Latin, lit. 'you should have the body') is an equitable remedy by which a report can be made to a court alleging the unlawful detention or imprisonment of an individual, and requesting that the court order the individual's custodian (usually a prison official) to bring the prisoner to court, to determine whether their detention is lawful.
The writ of habeas corpus was described in the eighteenth century by William Blackstone as a "great and efficacious writ in all manner of illegal confinement". It is a summons with the force of a court order; it is addressed to the custodian (a prison official, for example) and demands that a prisoner be brought before the court, and that the custodian present proof of authority, allowing the court to determine whether the custodian has lawful authority to detain the prisoner. If the custodian is acting beyond their authority, then the prisoner must be released. Any prisoner, or another person acting on their behalf, may petition the court, or a judge, for a writ of habeas corpus. One reason for the writ to be sought by a person other than the prisoner is that the detainee might be held incommunicado. Most Continental European law-influenced jurisdictions provide a similar remedy for those unlawfully detained, but this is not always called habeas corpus. For example, in some Spanish-speaking nations, the equivalent remedy for unlawful imprisonment is the amparo de libertad ("protection of freedom").
Habeas corpus has certain limitations. The petitioner must present a prima facie case that a person has been unlawfully restrained. As a procedural remedy, it applies when detention results from neglect of legal process, but not when the lawfulness of the process itself is in question. In some countries, the writ has been temporarily or permanently suspended on the basis of a war or state of emergency, for example with the Habeas Corpus Suspension Act 1794 in Britain and the Habeas Corpus Suspension Act (1863) in the United States. The right to petition for a writ of habeas corpus has nonetheless long been celebrated as the most efficient safeguard of the liberty of the subject. The English jurist Albert Venn Dicey wrote that the British Habeas Corpus Acts "declare no principle and define no rights, but they are for practical purposes worth a hundred constitutional articles guaranteeing individual liberty".
The writ of habeas corpus is one of what are called the "extraordinary", "common law", or "prerogative writs", which were historically issued by the English courts in the name of the monarch to control inferior courts and public authorities within the kingdom. The most common of the other such prerogative writs are quo warranto, prohibito, mandamus, procedendo, and certiorari. The due process for such petitions is not simply civil or criminal, because they incorporate the presumption of non-authority. The official who is the respondent must prove authority to do or not do something. Failing that, the court must decide for the petitioner, who may be any person, not just an interested party. This differs from a motion in a civil process in which the movant must have standing, and bears the burden of proof.

## Etymology

The phrase is from the Latin habeās, second person singular present subjunctive active of habēre "to have", "to hold"; and corpus, accusative singular of corpus "body". In reference to more than one person, the phrase is habeas corpora.
Literally, the phrase means "[we command] that you should have the [detainee's] body [brought to court]"; that is, that the detainee be brought to court in person. The complete phrase habeas corpus [coram nobis] ad subjiciendum means "that you have the person [before us] for the purpose of subjecting (the case to examination)". Those are the words of writs included in a 14th-century Anglo-French document requiring a person be brought before a court or judge—especially to determine whether the person is being detained legally.
|We command you, that the body of A.B. in our prison under your custody detained, as it is said, together with the day and cause of his taking and detention, by whatever name the said A.B. may be known therein, you have at our Court ... to undergo and to receive that which our Court shall then and there consider and order in that behalf. Hereof in no way fail, at your peril. And have you then there this writ.}}

### Examples
#### United Kingdom

   Victoria by the Grace of God, of the United Kingdom of Great Britain and Ireland Queen, Defender of the Faith,
   To J.K., Keeper of our Gaol, in the Island of Jersey, and to J.C. Viscount of said Island, Greeting.
   We command you that you have the body of C.C.W. detained in our prison under your custody, as it is said, together with the day and cause of his being taken and detained, by whatsoever name he may be called or known, in our Court before us, at Westminster, on the 18th day of January next, to undergo and receive all and singular such matters and things which our said Court shall then and there consider of in this behalf; and have there then this Writ.

#### United States

   United States of America, Second Judicial Circuit, Southern District of New York, ss.:
   We command you that the body of Charles L. Craig, in your custody detained, as it is said, together with the day and cause of his caption and detention, you safely have before Honorable Martin T. Manton, United States Circuit Judge for the Second Judicial Circuit, within the circuit and district aforesaid, to do and receive all and singular those things which the said judge shall then and there consider of him in this behalf; and have you then and there this writ.

### Similarly named writs

The full name of the writ is often used to distinguish it from similar ancient writs, also named habeas corpus. These include:
* Habeas corpus ad deliberandum et recipiendum: a writ for bringing an accused from a different county into a court in the place where a crime had been committed for purposes of trial, or more literally to return holding the body for purposes of "deliberation and receipt" of a decision ("extradition").
* Habeas corpus ad faciendum et recipiendum (also called habeas corpus cum causa): a writ of a superior court to a custodian to return with the body being held by the order of a lower court "with reasons", for the purpose of "receiving" the decision of the superior court and of "doing" what it ordered.
* Habeas corpus ad prosequendum: a writ ordering return with a prisoner for the purpose of "prosecuting" him before the court.
* Habeas corpus ad respondendum: a writ ordering return to allow the prisoner to "answer" to new proceedings before the court.
* Habeas corpus ad testificandum: a writ ordering return with the body of a prisoner for the purposes of "testifying".

## Origins in England

Habeas corpus originally stems from the Assize of Clarendon of 1166, a reissuance of rights during the reign of Henry II of England in the 12th century. The foundations for habeas corpus are "wrongly thought" to have originated in Magna Carta but in fact predate it. This charter declared that:
   No Freeman shall be taken or imprisoned, or be disseized of his Freehold, or Liberties, or free Customs, or be outlawed, or exiled, or any other wise destroyed; nor will We not pass upon him, nor condemn him, but by lawful judgment of his Peers, or by the Law of the land.
However the preceding article of Magna Carta, nr 38, declares:
   No legal officer shall start proceedings against anyone [not just freemen, this was even then a universal human right] on his own mere say-so, without reliable witnesses having been brought for the purpose. - in the original Latin: Nullus balivus ponat aliquem ad legem, simplici sua loquela, sine testibus fidelibus ad hoc aductis
Pursuant to that language, a person may not be subjected to any legal proceeding — such as arrest and imprisonment — without sufficient evidence having already been collected to show that there is a prima facie case to answer. The evidence must be collected beforehand because it must be available for exhibition in a public hearing within hours — or at most — days after arrest. Any charge levelled at the hearing thus must be based on evidence already collected, and an arrest and incarceration order is not lawful if not supported by sufficient evidence.
William Blackstone cites the first recorded usage of habeas corpus ad subjiciendum in 1305, during the reign of King Edward I. However, other writs were issued with the same effect as early as the reign of Henry II in the 12th century. Blackstone explained the basis of the writ, saying "[t]he king is at all times entitled to have an account, why the liberty of any of his subjects is restrained, wherever that restraint may be inflicted." The procedure for issuing a writ of habeas corpus was first codified by the Habeas Corpus Act 1679, following judicial rulings which had restricted the effectiveness of the writ. A previous law (the Habeas Corpus Act 1640) had been passed forty years earlier to overturn a ruling that the command of the king was a sufficient answer to a petition of habeas corpus. The cornerstone purpose of the writ of habeas corpus was to limit the king's Chancery's ability to undermine the surety of law by allowing courts of justice decisions to be overturned in favor and application of equity, a process managed by the Chancellor (a bishop) with the king's authority.
The 1679 codification of habeas corpus took place in the context of a sharp confrontation between King Charles II and Parliament, which was dominated by the then sharply oppositional, nascent Whig Party. The Whig leaders had good reasons to fear the king moving against them through the courts (as indeed happened in 1681) and regarded habeas corpus as safeguarding their own persons. The short-lived parliament which made this enactment came to be known as the Habeas Corpus Parliament – being dissolved by the king immediately afterwards.
Then, as now, the writ of habeas corpus was issued by a superior court in the name of the sovereign, and commanded the addressee (a lower court, sheriff, or private subject) to produce the prisoner before the royal courts of law. A habeas corpus petition could be made by the prisoner him or herself or by a third party on his or her behalf and, as a result of the Habeas Corpus Acts, could be made regardless of whether the court was in session, by presenting the petition to a judge. Since the 18th century the writ has also been used in cases of unlawful detention by private individuals, most famously in Somersett's Case (1772), where the black slave, Somersett, was ordered to be freed. During that case, these famous words are said to have been uttered: "... that the air of England was too pure for slavery" (although it was the lawyers in argument who expressly used this phrase – referenced from a much earlier argument heard in the Star Chamber – and not Lord Mansfield himself). During the Seven Years' War and later conflicts, the writ was used on behalf of soldiers and sailors pressed into military and naval service. The Habeas Corpus Act 1816 introduced some changes and expanded the territoriality of the legislation.
The privilege of habeas corpus has been suspended or restricted several times during English history, most recently during the 18th and 19th centuries. Although internment without trial has been authorised by statute since that time, for example during the two World Wars and the Troubles in Northern Ireland, the habeas corpus procedure has in modern times always technically remained available to such internees. However, as habeas corpus is only a procedural device to examine the lawfulness of a prisoner's detention, so long as the detention is in accordance with an Act of Parliament, the petition for habeas corpus is unsuccessful. Since the passage of the Human Rights Act 1998, the courts have been able to declare an Act of Parliament to be incompatible with the European Convention on Human Rights, but such a declaration of incompatibility has no legal effect unless and until it is acted upon by the government.
The wording of the writ of habeas corpus implies that the prisoner is brought to the court for the legality of the imprisonment to be examined. However, rather than issuing the writ immediately and waiting for the return of the writ by the custodian, modern practice in England is for the original application to be followed by a hearing with both parties present to decide the legality of the detention, without any writ being issued. If the detention is held to be unlawful, the prisoner can usually then be released or bailed by order of the court without having to be produced before it. With the development of modern public law, applications for habeas corpus have been to some extent discouraged, in favour of applications for judicial review. The writ, however, maintains its vigour, and was held by the UK Supreme Court in 2012 to be available in respect of a prisoner captured by British forces in Afghanistan, albeit that the Secretary of State made a valid return to the writ justifying the detention of the claimant.

## Precedents in medieval Catalonia and Biscay

Although the first recorded historical references come from Anglo-Saxon law in the 12th century and one of the first documents referring to this right is a law of the English Parliament (1679), in Catalonia, there are references from 1428 in the recurs de manifestació de persones (appeal of people's manifestation) collected in the Furs de les Corts of the Crown of Aragon and some references to this term in the Law of the Lordship of Biscay (1527).

## Other jurisdictions
### Australia

The writ of habeas corpus as a procedural remedy is part of Australia's English law inheritance. In 2005, the Australian parliament passed the Australian Anti-Terrorism Act 2005. Some legal experts questioned the constitutionality of the act, due in part to limitations it placed on habeas corpus.

### Canada

Habeas corpus rights are part of the English legal tradition inherited by Canada. The rights exist in the common law and have been enshrined in section 10(c) of the Charter of Rights and Freedoms, which states that "[e]veryone has the right on arrest or detention ... to have the validity of the detention determined by way of habeas corpus and to be released if the detention is not lawful". The test for habeas corpus in Canada was established by the Supreme Court of Canada in Mission Institution v Khela, as follows:
   To be successful, an application for habeas corpus must satisfy the following criteria. First, the applicant [i.e., the person seeking habeas corpus review] must establish that he or she has been deprived of liberty. Once a deprivation of liberty is proven, the applicant must raise a legitimate ground upon which to question its legality. If the applicant has raised such a ground, the onus shifts to the respondent authorities [i.e., the person or institution detaining the applicant] to show that the deprivation of liberty was lawful.
Suspension of the writ in Canadian history occurred at multiple times. During the October Crisis in 1970, the War Measures Act was invoked by the Governor General of Canada on the constitutional advice of Prime Minister Pierre Trudeau, who had received a request from the Quebec Cabinet. The Act was also used to justify German, Slavic, and Ukrainian Canadian internment during World War I, and the internment of German-Canadians, Italian-Canadians and Japanese-Canadians during World War II. The writ was suspended for several years following the Battle of Fort Erie (1866) during the Fenian Raids, though the suspension was only ever applied to suspects in the Thomas D'Arcy McGee assassination.
The writ is available where there is no other adequate remedy. However, a superior court always has the discretion to grant the writ even in the face of an alternative remedy (see May v Ferndale Institution). Under the Criminal Code the writ is largely unavailable if a statutory right of appeal exists, whether or not this right has been exercised.

### France

As a fundamental human right in the 1789 Declaration of the Rights of Man and of the Citizen drafted by Lafayette in co-operation with Thomas Jefferson, safeguards against arbitrary detention are enshrined in the French Constitution and regulated by the Penal Code. These safeguards are equivalent to those found under the Habeas-Corpus provisions found in Germany, the United States and several Commonwealth countries. The French system of accountability prescribes severe penalties for ministers, police officers and civil and judiciary authorities who either violate or fail to enforce the law.
   Article 7 of [1789] Declaration also provides that "No individual may be accused, arrested, or detained except where the law so prescribes, and in accordance with the procedure it has laid down." ... The Constitution further states that "No one may be arbitrarily detained. The judicial authority, guardian of individual liberty, ensures the observance of this principle under the condition specified by law." Its article 5 provides that everyone has the right to liberty and sets forth permissible circumstances under which people may be deprived of their liberty and procedural safeguards in case of detention. In particular, it states that "anyone deprived of his liberty by arrest or detention shall be entitled to take proceedings by which the lawfulness of his detention shall be decided speedily by a court and his release ordered if the detention is not lawful".
France and the United States played a synergistic role in the international team, led by Eleanor Roosevelt, which crafted the Universal Declaration of Human Rights. The French judge and Nobel Peace Laureate René Cassin produced the first draft and argued against arbitrary detentions. René Cassin and the French team subsequently championed the habeas corpus provisions enshrined in the European Convention for the Protection of Human Rights and Fundamental Freedoms.

### Germany

Germany has constitutional guarantees against improper detention and these have been implemented in statutory law in a manner that can be considered as equivalent to writs of habeas corpus.
Article 104, paragraph 1 of the Basic Law for the Federal Republic of Germany provides that deprivations of liberty may be imposed only on the basis of a specific enabling statute that also must include procedural rules. Article 104, paragraph 2 requires that any arrested individual be brought before a judge by the end of the day following the day of the arrest. For those detained as criminal suspects, article 104, paragraph 3 specifically requires that the judge must grant a hearing to the suspect in order to rule on the detention.
Restrictions on the power of the authorities to arrest and detain individuals also emanate from article 2 paragraph 2 of the Basic Law which guarantees liberty and requires a statutory authorization for any deprivation of liberty. In addition, several other articles of the Basic Law have a bearing on the issue. The most important of these are article 19, which generally requires a statutory basis for any infringements of the fundamental rights guaranteed by the Basic Law while also guaranteeing judicial review; article 20, paragraph 3, which guarantees the rule of law; and article 3 which guarantees equality.
In particular, a constitutional obligation to grant remedies for improper detention is required by article 19, paragraph 4 of the Basic Law, which provides as follows: "Should any person's right be violated by public authority, he may have recourse to the courts. If no other jurisdiction has been established, recourse shall be to the ordinary courts."

### India

In the Republic of India, the Supreme Court and High Courts possess the authority to issue a writ of habeas corpus, as granted by Articles 32 and 226 of the Constitution of India, respectively.
   (1) The right to move the Supreme Court by appropriate proceedings for the enforcement of the rights conferred by (Part III) is guaranteed.
   (2) The Supreme Court shall have power to issue directions or orders or writs, including writs in the nature of habeas corpus, mandamus, prohibition, quo warranto and certiorari, whichever may be appropriate, for the enforcement of any of the rights conferred by (Part III).
   (1) Notwithstanding anything in article 32, every High Court shall have power, throughout the territories in relation to which it exercises jurisdiction, to issue to any person or authority, including in appropriate cases, any Government, within those territories directions, orders or writs, including writs in the nature of habeas corpus, mandamus, prohibition, quo warranto and certiorari, or any of them, for the enforcement of any of the rights conferred by Part III and for any other purpose.
On 9 December 1948, during a session of the Constituent Assembly, H.V. Kamath, a member, suggested the removal of specific references to writs in Article 32, expressing concern that such references could restrict judges from establishing new types of writs in the future, while Dr. B.R. Ambedkar, the Chairperson of the Drafting Committee, emphasized the significance of retaining references to the writs. Dr. B.R. Ambedkar noted that writs, including habeas corpus, are already part of the Indian legal framework, but the existing writs are vulnerable to modifications through legislative changes, whereby the legislature, particularly with a strong majority, can amend the relevant laws, potentially leading to the suspension of writs like habeas corpus. However, following the Constitution's enactment, which includes explicit references to writs, these writs cannot be easily nullified by any legislative body because the Constitution grants the Supreme Court the authority to issue them.
The Indian judiciary, in a catena of cases, has effectively resorted to the writ of habeas corpus to secure release of a person from illegal detention. The Indian judiciary has dispensed with the traditional doctrine of locus standi, so that if a detained person is not in a position to file a petition, it can be moved on his behalf by any other person. The scope of habeas relief has expanded in recent times by actions of the Indian judiciary.
Usually, in most other jurisdictions, the writ is directed at police authorities. The extension to non-state authorities has its grounds in two cases: the 1898 Queen's Bench case of Ex Parte Daisy Hopkins, wherein the Proctor of Cambridge University did detain and arrest Hopkins without his jurisdiction, and Hopkins was released, and that of Somerset v Stewart, in which an African slave whose master had moved to London was freed by action of the writ. For example, in October 2009, the Karnataka High Court heard a habeas corpus petition filed by the parents of a girl who married a Muslim boy from Kannur district and was allegedly confined in a madrasa in Malapuram town. In 1976, the habeas writ was used in the Rajan case, a student victim of torture in local police custody during the nationwide Emergency in India. On 12 March 2014, Subrata Roy's counsel approached the Chief Justice moving a habeas corpus petition. It was also filed by the Panthers Party to protest the imprisonment of Anna Hazare, a social activist.

### Ireland

In the Republic of Ireland, the writ of habeas corpus is available at common law and under the Habeas Corpus Acts of 1782 and 1816.
A remedy equivalent to habeas corpus is also guaranteed by Article 40 of the 1937 constitution. The article guarantees that "no citizen shall be deprived of his personal liberty save in accordance with law" and outlines a specific procedure for the High Court to enquire into the lawfulness of any person's detention. It does not mention the Latin term habeas corpus, but includes the English phrase "produce the body".
Article 40.4.2° provides that a prisoner, or anyone acting on his behalf, may make a complaint to the High Court (or to any High Court judge) of unlawful detention. The court must then investigate the matter "forthwith" and may order that the defendant bring the prisoner before the court and give reasons for his detention. The court must immediately release the detainee unless it is satisfied that he is being held lawfully. The remedy is available not only to prisoners of the state, but also to persons unlawfully detained by any private party. However, the constitution provides that the procedure is not binding on the Defence Forces during a state of war or armed rebellion.
The full text of Article 40.4.2° is as follows:
   Upon complaint being made by or on behalf of any person to the High Court or any judge thereof alleging that such person is being unlawfully detained, the High Court and any and every judge thereof to whom such complaint is made shall forthwith enquire into the said complaint and may order the person in whose custody such person is detained to produce the body of such person before the High Court on a named day and to certify in writing the grounds of his detention, and the High Court shall, upon the body of such person being produced before that Court and after giving the person in whose custody he is detained an opportunity of justifying the detention, order the release of such person from such detention unless satisfied that he is being detained in accordance with the law. [italics added]
The writ of habeas corpus continued as part of the Irish law when the state seceded from the United Kingdom in 1922. A remedy equivalent to habeas corpus was also guaranteed by Article 6 of the Constitution of the Irish Free State, enacted in 1922. That article used similar wording to Article 40.4 of the current constitution, which replaced it 1937.
The relationship between the Article 40 and the Habeas Corpus Acts of 1782 and 1816 is ambiguous, and Forde and Leonard write that "The extent if any to which Article 40.4 has replaced these Acts has yet to be determined". In The State (Ahern) v. Cotter (1982) Walsh J. opined that the ancient writ referred to in the Habeas Corpus Acts remains in existence in Irish law as a separate remedy from that provided for in Article 40.
In 1941, the Article 40 procedure was restricted by the Second Amendment. Prior to the amendment, a prisoner had the constitutional right to apply to any High Court judge for an enquiry into her detention, and to as many High Court judges as she wished. If the prisoner successfully challenged her detention before the High Court she was entitled to immediate, unconditional release.
The Second Amendment provided that a prisoner has only the right to apply to a single judge, and, once a writ has been issued, the President of the High Court has authority to choose the judge or panel of three judges who will decide the case. If the High Court finds that the prisoner's detention is unlawful due to the unconstitutionality of a law the judge must refer the matter to the Supreme Court, and until the Supreme Court's decision is rendered the prisoner may be released only on bail.
The power of the state to detain persons prior to trial was extended by the Sixteenth Amendment, in 1996. In 1965, the Supreme Court ruled in the O'Callaghan case that the constitution required that an individual charged with a crime could be refused bail only if she was likely to flee or to interfere with witnesses or evidence. Since the Sixteenth Amendment, it has been possible for a court to take into account whether a person has committed serious crimes while on bail in the past.

### Italy

The right to freedom from arbitrary detention is guaranteed by Article 13 of the Constitution of Italy, which states:
   Personal liberty is inviolable. No one may be detained, inspected, or searched nor otherwise subjected to any restriction of personal liberty except by order of the Judiciary stating a reason and only in such cases and in such manner as provided by the law. In exceptional circumstances and under such conditions of necessity and urgency as shall conclusively be defined by the law, the police may take provisional measures that shall be referred within 48 hours to the Judiciary for validation and which, in default of such validation in the following 48 hours, shall be revoked and considered null and void. Any act of physical and moral violence against a person subjected to restriction of personal liberty shall be punished. The law shall establish the maximum duration of preventive detention.
This implies that within 48 hours every arrest made by a police force must be validated by a court.
Furthermore, if subject to a valid detention, an arrested can ask for a review of the detention to another court, called the Review Court (Tribunale del Riesame, also known as the Freedom Court, Tribunale della Libertà).

### Macau

In Macau, the relevant provision is Article 204 in the Code of Penal Processes, which became law in 1996 under Portuguese rule. Habeas corpus cases are heard before the Tribunal of Ultimate Instance. A notable case is Case 3/2008 in Macau.

### Malaysia

In Malaysia, the remedy of habeas corpus is guaranteed by the federal constitution, although not by name. Article 5(2) of the Constitution of Malaysia provides that "Where complaint is made to a High Court or any judge thereof that a person is being unlawfully detained the court shall inquire into the complaint and, unless satisfied that the detention is lawful, shall order him to be produced before the court and release him".
As there are several statutes, for example, the Internal Security Act 1960, that still permit detention without trial, the procedure is usually effective in such cases only if it can be shown that there was a procedural error in the way that the detention was ordered.

### New Zealand

In New Zealand, habeas corpus may be invoked against the government or private individuals. In 2006, a child was allegedly kidnapped by his maternal grandfather after a custody dispute. The father began habeas corpus proceedings against the mother, the grandfather, the grandmother, the great-grandmother, and another person alleged to have assisted in the kidnap of the child. The mother did not present the child to the court and so was imprisoned for contempt of court. She was released when the grandfather came forward with the child in late January 2007.

### Pakistan

Issuance of a writ is an exercise of an extraordinary jurisdiction of the superior courts in Pakistan. A writ of habeas corpus may be issued by any High Court of a province in Pakistan. Article 199 of the 1973 Constitution of the Islamic Republic of Pakistan, specifically provides for the issuance of a writ of habeas corpus, empowering the courts to exercise this prerogative. Subject to the Article 199 of the Constitution, "A High Court may, if it is satisfied that no other adequate remedy is provided by law, on the application of any person, make an order that a person in custody within the territorial jurisdiction of the Court be brought before it so that the Court may satisfy itself that he is not being held in custody without a lawful authority or in an unlawful manner". The hallmark of extraordinary constitutional jurisdiction is to keep various functionaries of State within the ambit of their authority. Once a High Court has assumed jurisdiction to adjudicate the matter before it, justiciability of the issue raised before it is beyond question. The Supreme Court of Pakistan has stated that the use of words "in an unlawful manner" implies that the court may examine whether it was a colorable exercise of the power of authority, if a statute has allowed such detention. The court can then examine whether this was action was taken in bad faith.

### Portugal

In Portugal, article 31 of the Constitution guarantees citizens against improper arrest, imprisonment or detention.
The full text of Article 31 is as follows:
   Article 31 (Habeas corpus)
   * Habeas corpus is available to counter misuse of power in the form of illegal arrest, imprisonment or detention. Application for it must be made to the competent court.
   * Application for a habeas corpus order may be made by the person so arrested, imprisoned or detained, or by any citizen in possession of his political rights.
   * Within a time limit of eight days of an application for habeas corpus, the judge shall rule thereon in a hearing that shall be subject to the adversarial principle.
There are also statutory provisions, most notably the Code of Criminal Procedure, articles 220 and 222 that stipulate the reasons by which a judge may guarantee habeas corpus.

### The Philippines

In the Bill of Rights of the Philippine constitution, habeas corpus is guaranteed in terms almost identically to those used in the U.S. Constitution. Article 3, Section 15 of the Constitution of the Philippines states that "The privilege of the writ of habeas corpus shall not be suspended except in cases of invasion or rebellion when the public safety requires it".
In 1971, after the Plaza Miranda bombing, the Marcos administration, under Ferdinand Marcos, suspended habeas corpus in an effort to stifle the oncoming insurgency, having blamed the Filipino Communist Party for the events of 21 August. Many considered this to be a prelude to martial law. After widespread protests, however, the Marcos administration decided to reintroduce the writ. The writ was again suspended when Marcos declared martial law in 1972.
In December 2009, habeas corpus was suspended in Maguindanao as President Gloria Macapagal Arroyo placed the province under martial law. This occurred in response to the Maguindanao massacre.
In 2016, President Rodrigo Duterte said he was planning on suspending habeas corpus.
At 10 pm on 23 May 2017 Philippine time, President Rodrigo Duterte declared martial law in the whole island of Mindanao including Sulu and Tawi-tawi for the period of 60 days due to the series of attacks mounted by the Maute group, an ISIS-linked terrorist organization. The declaration suspended the writ.

### Scotland

The Parliament of Scotland passed a law to have the same effect as habeas corpus in the 18th century. This is now known as the Criminal Procedure Act 1701 (c. 6). It was originally called "the Act for preventing wrongful imprisonment and against undue delays in trials". It is still in force although certain parts have been repealed.

### Spain

The present Constitution of Spain states that "A habeas corpus procedure shall be provided for by law to ensure the immediate handing over to the judicial authorities of any person illegally arrested". The statute which regulates the procedure is the Law of Habeas Corpus of 24 May 1984, which provides that a person imprisoned may, on her or his own or through a third person, allege that she or he is imprisoned unlawfully and request to appear before a judge. The request must specify the grounds on which the detention is considered to be unlawful, which can be, for example, that the custodian holding the prisoner does not have the legal authority, that the prisoner's constitutional rights have been violated, or that he has been subjected to mistreatment. The judge may then request additional information if needed, and may issue a habeas corpus order, at which point the custodian has 24 hours to bring the prisoner before the judge.
Historically, many of the territories of Spain had remedies equivalent to the habeas corpus, such as the privilege of manifestación in the Crown of Aragon or the right of the Tree in Biscay.

### Taiwan

Habeas corpus is explicitly stated in article 8 of the Constitution of the Republic of China, in which guarantees that anyone has the right to request a writ of habeas corpus for himself or any other person that is being detained by any organization or individual other than courts. Also, courts shall not reject the request, nor order the detainer to investigate and report before surrendering the detainee; the detainer must bring the person in question to the court within 24 hours without condition, and the detainee shall be released on the spot if the detention is deemed illegal. The article was further enforced by the Habeas Corpus Act.

### United States

The United States inherited habeas corpus from the English common law. In England, the writ was issued in the name of the monarch. When the original thirteen American colonies declared independence, and became a republic based on popular sovereignty, any person, in the name of the people, acquired authority to initiate such writs. The U.S. Constitution specifically includes the habeas procedure in the Suspension Clause (Clause 2), located in Article One, Section 9. This states that "The privilege of the writ of habeas corpus shall not be suspended, unless when in cases of rebellion or invasion the public safety may require it".
The writ of habeas corpus ad subjiciendum is a civil, not criminal, ex parte proceeding in which a court inquires as to the legitimacy of a prisoner's custody. Typically, habeas corpus proceedings are to determine whether the court that imposed sentence on the defendant had jurisdiction and authority to do so, or whether the defendant's sentence has expired. Habeas corpus is also used as a legal avenue to challenge other types of custody such as pretrial detention or detention by the United States Bureau of Immigration and Customs Enforcement pursuant to a deportation proceeding.
Presidents Abraham Lincoln and Ulysses Grant suspended habeas corpus during the Civil War and Reconstruction for some places or types of cases. During World War II, President Franklin D. Roosevelt suspended habeas corpus. Following the September 11 attacks, President George W. Bush attempted to place Guantanamo Bay detainees outside of the jurisdiction of habeas corpus, but the Supreme Court of the United States overturned this action in Boumediene v. Bush.

## Equivalent remedies
### Biscay

In 1526, the Fuero Nuevo of the Señorío de Vizcaya (New Charter of the Lordship of Biscay) established a form of habeas corpus in the territory of the Señorío de Vizcaya, now part of Spain. This revised version of the Fuero Viejo (Old Charter) of 1451 codified the medieval custom whereby no person could be arbitrarily detained without being summoned first to the Oak of Gernika, an ancestral oak tree located in the outskirts of Gernika under which all laws of the Lordship of Biscay were passed.
The New Charter formalised that no one could be detained without a court order (Law 26 of Chapter 9) nor due to debts (Law 3 of Chapter 16). It also established due process and a form of habeas corpus: no one could be arrested without previously having been summoned to the Oak of Gernika and given 30 days to answer the said summons. Upon appearing under the Tree, they had to be provided with accusations and all evidence held against them so that they could defend themselves (Law 7 of Chapter 9).
No one could be sent to prison or deprived of their freedom until being formally trialed. No one could be accused of a different crime until their current court trial was over (Law 5 of Chapter 5). Those fearing they were being arrested illegally could appeal to the Regimiento General that their rights could be upheld. The Regimiento, the executive arm of the Juntas Generales of Biscay, would demand the prisoner be handed over to them, and thereafter the prisoner would be released and placed under the protection of the Regimiento while awaiting trial.

### Crown of Aragon

The Crown of Aragon had a remedy equivalent to the habeas corpus called the manifestación de personas, literally, demonstration of persons. According to the right of manifestación, the Justicia de Aragon, lit. Justice of Aragon, an Aragonese judiciary figure similar to an ombudsman, but with far reaching executive powers, could require a judge, a court of justice, or any other official that they handed over to the Justicia, i.e., that they be demonstrated to the Justicia, anyone being prosecuted, so as to guarantee that this person's rights were upheld, and that no violence would befall this person prior to their being sentenced.
The Justicia retained the right to examine the judgement passed, and decide whether it satisfied the conditions of a fair trial. If the Justicia was not satisfied, he could refuse to hand over the accused back to the authorities. The right of manifestación acted like a habeas corpus: knowing that the appeal to the Justicia would immediately follow any unlawful detention, these were effectively illegal. Equally, torture, which had been banned in Aragon since 1325, would never take place.
In some cases, people exerting their right of manifestación were kept under the Justicia's watch in manifestación prisons, famous for their mild and easy conditions, or under house arrest. More generally however, the person was released from confinement and placed under the Justicia's protection, awaiting for trial. The Justicia always granted the right of manifestación by default, but they only really had to act in extreme cases, as for instance famously happened in 1590 when Antonio Pérez, the disgraced secretary to Philip II of Spain, fled from Castile to Aragon and used his Aragonese ascendency to appeal to the Justicia for manifestación right, thereby preventing his arrest at the King's behest.
The right of manifestación was codified in 1325 in the Declaratio Privilegii generalis passed by the Aragonese Corts under king James II of Aragon. It had been practised since the inception of the kingdom of Aragon in the 11th century, and therefore predates the English habeas corpus itself.

### Poland

In 1430, King Władysław II Jagiełło of Poland granted the Privilege of Jedlnia, which proclaimed, Neminem captivabimus nisi iure victum ("We will not imprison anyone except if convicted by law"). This revolutionary innovation in civil libertarianism gave Polish citizens due process-style rights that did not exist in any other European country for another 250 years. Originally, the Privilege of Jedlnia was restricted to the nobility, the szlachta. It was extended to cover townsmen in the 1791 Constitution. Importantly, social classifications in the Polish–Lithuanian Commonwealth were not as rigid as in other European countries; townspeople and Jews were sometimes ennobled. The Privilege of Jedlnia provided broader coverage than many subsequently enacted habeas corpus laws, because Poland's nobility constituted an unusually large percentage of the country's total population, which was Europe's largest. As a result, by the 16th century, it was protecting the liberty of between five hundred thousand and a million Poles.

### Roman-Dutch law

In South Africa and other countries whose legal systems are based on Roman-Dutch law, the interdictum de homine libero exhibendo is the equivalent of the writ of habeas corpus. In South Africa, it has been entrenched in the Bill of Rights, which provides in section 35(2)(d) that every detained person has the right to challenge the lawfulness of the detention in person before a court and, if the detention is unlawful, to be released.

## World habeas corpus

In the 1950s, American lawyer Luis Kutner began advocating an international writ of habeas corpus to protect individual human rights. In 1952, he filed a petition for a "United Nations Writ of Habeas Corpus" on behalf of William N. Oatis, an American journalist jailed the previous year by the Communist government of Czechoslovakia. Alleging that Czechoslovakia had violated Oatis' rights under the United Nations Charter and the Universal Declaration of Human Rights and that the United Nations General Assembly had "inherent power" to fashion remedies for human rights violations, the petition was filed with the United Nations Commission on Human Rights.$^{:303,309–314}$ The commission forwarded the petition to Czechoslovakia, but no other United Nations action was taken. Oatis was released in 1953. Kutner went on to publish numerous articles and books advocating the creation of an "International Court of Habeas Corpus".

## International human rights standards

Article 3 of the Universal Declaration of Human Rights provides that "everyone has the right to life, liberty and security of person". Article 5 of the European Convention on Human Rights goes further and calls for persons detained to have the right to challenge their detention, providing at article 5.4:
   Everyone who is deprived of his liberty by arrest or detention shall be entitled to take proceedings by which the lawfulness of his detention shall be decided speedily by a court and his release ordered if the detention is not lawful.