> For AI agents: read the machine-readable documentation index at [https://corpuslaw.us/llms.txt](https://corpuslaw.us/llms.txt) or the single-file full reference at [https://corpuslaw.us/llms-full.txt](https://corpuslaw.us/llms-full.txt).

# Va. Code Ann. § 37.2-844 — Habeas corpus as means

- **Citation**: Va. Code Ann. § 37.2-844
- **Node Type**: section
- **Jurisdiction**: Virginia (state)
- **Code Body**: Code of Virginia (Aug. 2026 snapshot) (Va. Code Ann.)
- **Official Source**: [https://law.lis.virginia.gov/vacode/37.2-844/](https://law.lis.virginia.gov/vacode/37.2-844/)
- **Canonical URL**: [https://corpuslaw.us/codes/virginia/title-37-2/chapter-8/section-37-2-844](https://corpuslaw.us/codes/virginia/title-37-2/chapter-8/section-37-2-844)
- **Semantic URL**: [https://corpuslaw.us/codes/virginia/title-37-2/chapter-8/section-37-2-844](https://corpuslaw.us/codes/virginia/title-37-2/chapter-8/section-37-2-844)

## Hierarchy

Title 37.2 > Chapter 8

## Text

A. 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.

B. Any proceeding to challenge the continued secure inpatient treatment of a person held in custody as a sexually violent predator under Chapter 9 (§ 37.2-900 et seq.) of this title shall be conducted in accordance with § 37.2-910 .

Code 1950, §§ 37-122, 37-123; 1950, p. 916; 1968, c. 477, § 37.1-103; 1976, c. 671; 2003, cc. 989 , 1018 ; 2005, c. 716 .
