The Habeas Corpus Act 1862 (20 & 26 Vict. c.20) was an Act of the Parliament of the United Kingdom that limited the right of the English courts to issue writs of habeas corpus in British colonies or dominions. The act was passed in response to Ex Parte Anderson, a case in the Canadian courts in which the English Court of King's Bench attempted to issue a writ of habeas corpus and have Anderson appear before an English judge. While the court issued the writ, it felt that setting such a precedent would interfere with the "higher degree of Colonial independence". As a result, the Act was passed, receiving the Royal Assent on 16 May 1862.
The statute consists of only two clauses:
s. 1 declares that no writ of habeas corpus can be issued by an English judge to any foreign nation or colony which forms part of the Queen's possessions (broadly speaking, the Commonwealth of Nations) if that nation has a court able to issue such a writ.
s. 2 states that the act does not affect the rights of citizens of those nations to appeal cases to the Judicial Committee of the Privy Council.
The Act was notably used in R v Secretary of State for Home Affairs ex parte O'Brien  2 KB 361, in which Sir Patrick Hastings' challenge to the deportation and internment of British citizens to the Irish Free State was rebuffed by the Divisional Court because the 1862 Act meant that the Court had no jurisdiction to order the release of the citizens.
In 1971 Lord Denning led the Court of Appeal in Re Keenan  3 WLR 844 in saying that no English court has jurisdiction to issue a writ of habeas corpus anywhere in Ireland, whether in Northern Ireland or the Republic of Ireland. He based this judgment partially on the 1862 Act, and partially on a judgment of Lord Mansfield construing the Repeal of Act for Securing Dependence of Ireland Act 1782 and the Irish Appeals Act 1783, in declining the opportunity to issue a writ in Northern Ireland.