Habeas Corpus Act 1867

The Habeas Corpus Act of 1867 (sess. ii, chap. 28, ) is an act of Congress that significantly expanded the jurisdiction of federal courts to issue writs of habeas corpus. Passed February 5, 1867, the Act amended the Judiciary Act of 1789 to grant the courts the power to issue writs of habeas corpus "in all cases where any person may be restrained of his or her liberty in violation of the constitution, or any treaty or law of the United States." Prior to the Act's passage, prisoners in the custody of one of the states who wished to challenge the legality of their detention could petition for a writ of habeas corpus only in state courts; the federal court system was barred from issuing writs of habeas corpus in their cases. The Act also permitted the court "to go beyond the return" and question the truth of the jailer's stated justification for detaining the petitioning prisoner, whereas prior to the Act courts were technically bound to accept the jailer's word that the prisoner was actually being held for the reason stated. The Act largely restored habeas corpus following its 1863 suspension by Congress, ensuring that anyone arrested after its passage could challenge their detention in the federal courts, but denied habeas relief to anyone who was already in military custody for any military offense or for having aided the Confederacy.
When the Habeas Corpus Act of 1867 is spoken of, it is usually this act that is meant. Another act dealing with habeas corpus was passed the same day and appears on the same page of the United States Statutes at Large, being the twenty-seventh rather than the twenty-eighth chapter. It amended the Habeas Corpus Suspension Act of 1863, which permitted (among other things) government officials charged with abusing their powers under the suspension of habeas corpus to have their cases heard at the federal rather than state level. The 1867 Act ensured that the federal courts could effectively hear the cases transferred to them by issuing a writ for habeas corpus cum causa.
Further reading.
"The Habeas Corpus Act of 1867: The Supreme Court as Legal Historian", Mayers L., 33 U.Chi.L.Rev. 31 (1965).