{"formats":[{"name":"JSON","format":"json","url":"\/downloads\/2025\/code-json\/37.2-844.json"},{"name":"Plain Text","format":"text","url":"\/downloads\/2025\/code-text\/37.2-844.txt"},{"name":"XML","format":"xml","url":"\/downloads\/2025\/code-xml\/37.2-844.xml"},{"name":"HTML","format":"html","url":"\/downloads\/2025\/code-html\/37.2-844.html"}],"law_id":70993,"edition_id":1,"section_id":70993,"structure_id":12891,"section_number":"37.2-844","catch_line":"Habeas corpus as means","history":"Code 1950, \u00a7\u00a7 37-122, 37-123; 1950, p. 916; 1968, c. 477, \u00a7 37.1-103; 1976, c. 671; 2003, cc. 989, 1018; 2005, c. 716.","full_text":"A\n\nAny person held in custody because of his mental illness may by petition for a writ of habeas corpus have the question of the legality of his detention determined by a court of competent jurisdiction. Upon the petition, after notice to the authorities of the facility or other institution in which the person is confined, the court shall determine in a courtroom of the county or city or in some other convenient public place in that county or city, whether the person has a mental illness and whether he should be detained.B\n\nAny proceeding to challenge the continued secure inpatient treatment of a person held in custody as a sexually violent predator under Chapter 9 (&#xA7; 37.2-900 et seq.) of this title shall be conducted in accordance with &#xA7; 37.2-910.","order_by":null,"text":{"0":{"id":255999,"text":"Any person held in custody because of his mental illness may by petition for a writ of habeas corpus have the question of the legality of his detention determined by a court of competent jurisdiction. Upon the petition, after notice to the authorities of the facility or other institution in which the person is confined, the court shall determine in a courtroom of the county or city or in some other convenient public place in that county or city, whether the person has a mental illness and whether he should be detained.","type":"section","prefixes":["A"],"prefix":"A","entire_prefix":"A","prefix_anchor":"A","level":1,"next_prefix":"B"},"1":{"id":256000,"text":"Any proceeding to challenge the continued secure inpatient treatment of a person held in custody as a sexually violent predator under Chapter 9 (&#xA7; 37.2-900 et seq.) of this title shall be conducted in accordance with &#xA7; 37.2-910.","type":"section","prefixes":["B"],"prefix":"B","entire_prefix":"B","prefix_anchor":"B","level":1,"prior_prefix":"A"}},"ancestry":[{"id":12891,"edition_id":1,"name":"Testing Legality of Detention","identifier":"8","label":"article","depth":4,"order_by":1,"parent_id":12890,"metadata":{},"date_created":"2026-06-26 03:43:59","date_modified":"2026-06-26 03:43:59","permalink":{"id":210485,"object_type":"structure","relational_id":12891,"identifier":"8","token":"37.2\/III\/8\/8","url":"\/37.2\/III\/8\/8\/","edition_id":1,"permalink":0,"preferred":1}},{"id":12890,"edition_id":1,"name":"Emergency Custody and Voluntary and Involuntary Civil Admissions","identifier":"8","label":"chapter","depth":3,"order_by":1,"parent_id":12889,"metadata":{},"date_created":"2026-06-26 03:43:59","date_modified":"2026-06-26 03:43:59","permalink":{"id":210257,"object_type":"structure","relational_id":12890,"identifier":"8","token":"37.2\/III\/8","url":"\/37.2\/III\/8\/","edition_id":1,"permalink":0,"preferred":1}},{"id":12889,"edition_id":1,"name":"Admissions and Dispositions","identifier":"III","label":"subtitle","depth":2,"order_by":1,"parent_id":12843,"metadata":{},"date_created":"2026-06-26 03:43:59","date_modified":"2026-06-26 03:43:59","permalink":{"id":210255,"object_type":"structure","relational_id":12889,"identifier":"III","token":"37.2\/III","url":"\/37.2\/III\/","edition_id":1,"permalink":0,"preferred":1}},{"id":12843,"edition_id":1,"name":"Behavioral Health and Developmental Services","identifier":"37.2","label":"title","depth":1,"order_by":1,"parent_id":null,"metadata":{},"date_created":"2026-06-26 03:43:56","date_modified":"2026-06-26 03:43:56","permalink":{"id":209673,"object_type":"structure","relational_id":12843,"identifier":"37.2","token":"37.2","url":"\/37.2\/","edition_id":1,"permalink":0,"preferred":1}}],"structure_contents":[{"id":70993,"structure_id":12891,"section_number":"37.2-844","catch_line":"Habeas corpus as means","url":"\/37.2-844\/","token":"37.2\/III\/8\/8\/37.2-844","metadata":false},{"id":77022,"structure_id":12891,"section_number":"37.2-845","catch_line":"Procedure when person confined in facility or other institution","url":"\/37.2-845\/","token":"37.2\/III\/8\/8\/37.2-845","metadata":false},{"id":54012,"structure_id":12891,"section_number":"37.2-846","catch_line":"Procedure when person not confined in facility or other institution","url":"\/37.2-846\/","token":"37.2\/III\/8\/8\/37.2-846","metadata":false},{"id":82613,"structure_id":12891,"section_number":"37.2-847","catch_line":"Duty of attorney for Commonwealth","url":"\/37.2-847\/","token":"37.2\/III\/8\/8\/37.2-847","metadata":false}],"next_section":{"id":77022,"structure_id":12891,"section_number":"37.2-845","catch_line":"Procedure when person confined in facility or other institution","url":"\/37.2-845\/","token":"37.2\/III\/8\/8\/37.2-845","metadata":false},"metadata":false,"official_url":"https:\/\/law.lis.virginia.gov\/vacode\/37.2-844\/","history_text":"<p>The record of this law\u2019s original creation isn\u2019t available online. It has been modified 4 times. Those modifications are cataloged by \u201cThe Acts of Assembly,\u201d a state publication, by year and chapter. Those modifications that can be read on the General Assembly\u2019s website will be linked accordingly. Those modifications are as follows: in 1968, chapter 477; in 1976, chapter 671; in 2003, chapters <a href=\"https:\/\/legacylis.virginia.gov\/cgi-bin\/legp604.exe?031+ful+CHAP0989\">989<\/a> and <a href=\"https:\/\/legacylis.virginia.gov\/cgi-bin\/legp604.exe?031+ful+CHAP1018\">1018<\/a>; in 2005, chapter <a href=\"https:\/\/legacylis.virginia.gov\/cgi-bin\/legp604.exe?051+ful+CHAP0716\">716<\/a>.<\/p>","references":[{"id":75804,"section_number":"37.2-821","catch_line":"Appeal of involuntary admission or certification order","order_by":null,"url":"\/37.2-821\/"},{"id":77022,"section_number":"37.2-845","catch_line":"Procedure when person confined in facility or other institution","order_by":null,"url":"\/37.2-845\/"}],"refers_to":[{"id":55224,"section_number":"37.2-900","catch_line":"Definitions","order_by":null,"url":"\/37.2-900\/"},{"id":57455,"section_number":"37.2-910","catch_line":"Review of continuation of secure inpatient treatment hearing; procedure and reports; disposition","order_by":null,"url":"\/37.2-910\/"}],"permalink":{"id":210487,"object_type":"law","relational_id":70993,"identifier":"37.2-844","token":"37.2\/III\/8\/8\/37.2-844","url":"\/37.2-844\/","edition_id":1,"permalink":0,"preferred":1},"url":"\/37.2-844\/","token":"37.2\/III\/8\/8\/37.2-844","dublin_core":{"Title":"Habeas corpus as means","Type":"Text","Format":"text\/html","Identifier":"\u00a7 37.2-844","Relation":"Code of Virginia"},"html":"\n\t\t\t\t\t\t<section id=\"A\"><p><span class=\"prefix-number\">A.<\/span> Any person held in <span class=\"dictionary\">custody<\/span> because of his <span class=\"dictionary\">mental illness<\/span> may by <span class=\"dictionary\">petition<\/span> for a <span class=\"dictionary\">writ<\/span> of <span class=\"dictionary\">habeas corpus<\/span> have the question of the legality of his detention determined by a <span class=\"dictionary\">court<\/span> of competent <span class=\"dictionary\">jurisdiction<\/span>. Upon the <span class=\"dictionary\">petition<\/span>, after notice to the authorities of the <span class=\"dictionary\">facility<\/span> or other institution in which the person is confined, the <span class=\"dictionary\">court<\/span> shall determine in a courtroom of the county or city or in some other convenient public place in that county or city, whether the person has a <span class=\"dictionary\">mental illness<\/span> and whether he should be detained. <a id=\"paragraph-255999\" class=\"section-permalink\" href=\"https:\/\/vacode.org\/37.2-844\/#A\"><i class=\"fa fa-link\"><\/i><\/a><\/p><\/section>\n\t\t\t\t\t\t<section id=\"B\"><p><span class=\"prefix-number\">B.<\/span> Any proceeding to challenge the continued secure inpatient treatment of a person held in <span class=\"dictionary\">custody<\/span> as a sexually violent predator under Chapter 9 (&#xA7; <a class=\"law\" title=\"Definitions\" href=\"\/37.2-900\/\">37.2-900<\/a> et seq.) of this title shall be conducted in accordance with &#xA7; <a class=\"law\" title=\"Review of continuation of secure inpatient treatment hearing; procedure and reports; disposition\" href=\"\/37.2-910\/\">37.2-910<\/a>. <a id=\"paragraph-256000\" class=\"section-permalink\" href=\"https:\/\/vacode.org\/37.2-844\/#B\"><i class=\"fa fa-link\"><\/i><\/a><\/p><\/section>","plain_text":"                                 CODE OF VIRGINIA\n\nHABEAS CORPUS AS MEANS (\u00a7 37.2-844)\n\nA. Any person held in custody because of his mental illness may by petition for\na writ of habeas corpus have the question of the legality of his detention\ndetermined by a court of competent jurisdiction. Upon the petition, after notice\nto the authorities of the facility or other institution in which the person is\nconfined, the court shall determine in a courtroom of the county or city or in\nsome other convenient public place in that county or city, whether the person\nhas a mental illness and whether he should be detained.\n\nB. Any proceeding to challenge the continued secure inpatient treatment of a\nperson held in custody as a sexually violent predator under Chapter 9 (&#xA7;\n37.2-900 et seq.) of this title shall be conducted in accordance with &#xA7;\n37.2-910.\n\nHISTORY: Code 1950, \u00a7\u00a7 37-122, 37-123; 1950, p. 916; 1968, c. 477, \u00a7\n37.1-103; 1976, c. 671; 2003, cc. 989, 1018; 2005, c. 716.","edition":{"id":1,"name":"2025","slug":"2025","date_created":"2026-06-21 22:39:22","date_modified":"2026-06-21 22:39:22","current":1,"order_by":1,"last_import":null}}