The origin of habeas corpus is lost in the mists of history. The leading idea, deliverance by summary legal process from illegal confinement, was present in the laws of countries in existence prior to the beginning of the English law and in other countries which derived none of their principles of jurisprudence or rules of procedure from English law. It was known to Roman law and to old Spanish law. It was recognized by the Magna Charta in 1215, although such recognition was probably not a primary purpose of the barons in forcing King John to sign that document. The writ itself originated in the common law of England, where it developed from a procedural writ to one of protection of the individual. In 1679, Parliament passed the famous Habeas Corpus Act, which, however, did not change the nature of the existing common law practice, and excepted treason and felony from its provisions.
Habeas Corpus and Court-Martial Prisoners,
6 Vanderbilt Law Review
Available at: https://scholarship.law.vanderbilt.edu/vlr/vol6/iss2/7