<?xml version="1.0"?>
<law><site_title>Virginia Decoded</site_title><site_url>https://vacode.org</site_url><law_id>77022</law_id><section_number>37.2-845</section_number><catch_line>Procedure when person confined in facility or other institution</catch_line><edition url="https://vacode.org/2025/" slug="2025" current="TRUE" last_updated="">2025</edition><referred_to_by><reference>37.2-846</reference></referred_to_by><structure><unit label="title" level="1" order_by="1" identifier="37.2">Behavioral Health and Developmental Services</unit><unit label="subtitle" level="2" order_by="1" identifier="III">Admissions and Dispositions</unit><unit label="chapter" level="3" order_by="1" identifier="8">Emergency Custody and Voluntary and Involuntary Civil Admissions</unit><unit label="article" level="4" order_by="1" identifier="8">Testing Legality of Detention</unit></structure><text>
						<section id="A"><p><span class="prefix-number">A.</span> If the person referenced in &#xA7; <a class="law" title="Habeas corpus as means" href="/37.2-844/">37.2-844</a> is held in <span class="dictionary">custody</span> and actually confined in any <span class="dictionary">facility</span> or other institution, he may file his <span class="dictionary">petition</span> in the <span class="dictionary">circuit</span> <span class="dictionary">court</span> of the county or the city in which the <span class="dictionary">facility</span> or other institution is located or in the <span class="dictionary">circuit</span> <span class="dictionary">court</span> of the county or the city adjoining the county or city in which the <span class="dictionary">facility</span> or other institution is located. <a id="paragraph-276408" class="section-permalink" href="https://vacode.org/37.2-845/#A"><i class="fa fa-link"/></a></p></section>
						<section id="B"><p><span class="prefix-number">B.</span> Any proceeding to challenge the continued secure inpatient treatment of any 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 the <span class="dictionary">circuit</span> <span class="dictionary">court</span> wherein the person was last convicted of a sexually violent <span class="dictionary">offense</span> or wherein the <span class="dictionary">defendant</span> was deemed unrestorably incompetent and referred for commitment pursuant to &#xA7; <a class="law" title="Disposition of the unrestorably incompetent defendant; aggravated murder charge; sexually violent offense charge" href="/19.2-169.3/">19.2-169.3</a>. <a id="paragraph-276409" class="section-permalink" href="https://vacode.org/37.2-845/#B"><i class="fa fa-link"/></a></p></section></text><history>Code 1950, &#xA7; 37-123; 1950, p. 916; 1968, c. 477, &#xA7; 37.1-104; 1976, c. 671; 2003, cc. 989, 1018; 2005, c. 716.</history><metadata></metadata></law>
