(a) On return of a writ of habeas corpus and production of a person and cause of his detention before a judge, the judge shall immediately inquire into the legality and propriety of the confinement or detention.
(b) If it appears to the judge that the person is detained without legal warrant or authority, he shall release or discharge the person immediately.
(c) If the judge considers the detention lawful and proper, the person shall be:
(1) Remanded to custody; or
(2) Admitted to bail.
(d) If the person is admitted to bail, the judge shall take a recognizance for his appearance in court and transmit it to a court having jurisdiction over the offense charged.
Structure Maryland Statutes
Courts and Judicial Proceedings
Title 3 - Courts of General Jurisdiction -- Jurisdiction/special Causes of Action
Section 3-701 - Power to Grant Writ and Exercise Jurisdiction
Section 3-702 - Person Who May Apply for Writ
Section 3-703 - Discretion of Judge When Prior Writ Has Been Refused
Section 3-704 - Inquiry Into Legality of Detention and Release or Remand
Section 3-705 - Persons Discharged Not to Be Imprisoned for Same Offense
Section 3-706 - Discharge for Unconstitutionality of Law
Section 3-707 - Application for Leave to Appeal in Regard to Bail