(a) A person committed, detained, confined, or restrained from his lawful liberty within the State for any alleged offense or under any color or pretense or any person in his behalf, may petition for the writ of habeas corpus to the end that the cause of the commitment, detainer, confinement, or restraint may be inquired into.
(b) (1) Upon receiving the petition, a judge shall grant the writ of habeas corpus immediately, if it appears that the petitioner is entitled to the relief, or shall immediately refer the application to any court in the judicial circuit in which the person confined was convicted, without taking any other action on the application.
(2) An application may not be referred to any judge who presided at the trial at which the person was convicted, except with the written consent of the applicant or the person confined.
(3) A court to which an application for a writ has been referred shall act immediately on the application and has no power to refer or transfer the application.
(4) In exercising discretion, the judge to whom an application for a writ is made shall consider the interests and convenience of all parties concerned, including the State.
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