<?xml version="1.0"?>
<law><site_title>Virginia Decoded</site_title><site_url>https://vacode.org</site_url><law_id>377766</law_id><section_number>8.01-662</section_number><catch_line>Judgment of court or judge trying it; payment of costs and expenses when petition denied</catch_line><edition url="https://vacode.org/2026/" slug="2026" current="TRUE" last_updated="2026-08-02">2026</edition><structure><unit label="title" level="1" order_by="12" identifier="8.01">Civil Remedies and Procedure</unit><unit label="chapter" level="2" order_by="55" identifier="25">Extraordinary Writs</unit><unit label="article" level="3" order_by="1" identifier="3">Habeas Corpus</unit></structure><text>
						<section><p>After <span class="dictionary">hearing</span> the matter both upon the response and any other <span class="dictionary">evidence</span>, the <span class="dictionary">court</span> shall either discharge or <span class="dictionary">remand</span> the petitioner, grant him any other relief to which he is entitled, or admit him to <span class="dictionary">bail</span> and adjudge the cost of the proceeding, including the charge for transporting the prisoner, provided, however, that if the <span class="dictionary">petition</span> is denied, the costs and expenses of the proceeding and the attorney fees of any attorney appointed to represent the petitioner shall be assessed against the petitioner. If such cost, expenses, and fees are collected, they shall be paid to the Commonwealth.</p><p>When relief is granted upon a <span class="dictionary">petition</span> for a <span class="dictionary">writ</span> of <span class="dictionary">habeas corpus</span>, the <span class="dictionary">order</span> granting relief on the <span class="dictionary">writ</span> shall be served on the respondent and the petitioner. Service may, in the <span class="dictionary">court</span>&#x2019;s discretion, be accomplished by personal service or by transmitting a certified copy of the <span class="dictionary">order</span> to the parties via regular or certified mail, a third-<span class="dictionary">party</span> commercial carrier, or electronic delivery.</p></section></text><history>Code 1950, &#xA7; 8-603; 1968, c. 482; 1977, c. 617; 2019, cc. 8, 48.</history><metadata><court_decisions><item key="0"><name>Kenneth A. Stokes, Jr. v. Commonwealth of Virginia</name><case_number>0090121</case_number><citation>61 Va. App. 388</citation><date>2013-01-15</date><url>https://www.courtlistener.com/opinion/1061488/kenneth-a-stokes-jr-v-commonwealth-of-virginia/</url><abstract> .&#x202F;.&#x202F;. ELDER, J., .&#x202F;.&#x202F;. </abstract><court_html><abbr title="Court of Appeals">COA</abbr></court_html></item><item key="1"><name>E.C. v. Virginia Dep't of Juvenile Justice</name><case_number>110523</case_number><citation></citation><date>2012-03-02</date><url>https://www.courtlistener.com/opinion/1057925/ec-v-virginia-dept-of-juvenile-justice/</url><abstract> .&#x202F;.&#x202F;. Present: Kinser, C.J., Lemons, Goodwyn, Millette, and .&#x202F;.&#x202F;. </abstract><court_html><abbr title="Supreme Court of Virginia">SCV</abbr></court_html></item><item key="2"><name>Smith v. Brown</name><case_number>Record 141487.</case_number><citation>781 S.E.2d 744</citation><date>2016-02-12</date><url>https://www.courtlistener.com/opinion/3177027/smith-v-brown/</url><abstract> .&#x202F;.&#x202F;. Opinion by Justice D. ARTHUR KELSEY. .&#x202F;.&#x202F;. </abstract><court_html><abbr title="Supreme Court of Virginia">SCV</abbr></court_html></item><item key="3"><name>Yeatts v. Murray</name><case_number>Record 940635</case_number><citation>455 S.E.2d 18</citation><date>1995-03-03</date><url>https://www.courtlistener.com/opinion/1219071/yeatts-v-murray/</url><abstract> .&#x202F;.&#x202F;. 455 S.E.2d 18 (1995) .&#x202F;.&#x202F;. </abstract><court_html><abbr title="Supreme Court of Virginia">SCV</abbr></court_html></item><item key="4"><name>Hill v. Commonwealth</name><case_number>Record No. 0932-86-2</case_number><citation>379 S.E.2d 134</citation><date>1989-04-04</date><url>https://www.courtlistener.com/opinion/1205495/hill-v-commonwealth/</url><abstract> .&#x202F;.&#x202F;. Opinion .&#x202F;.&#x202F;. </abstract><court_html><abbr title="Court of Appeals">COA</abbr></court_html></item><item key="5"><name>Walker v. Mitchell</name><case_number>Record 811936; Record 812038</case_number><citation>299 S.E.2d 698</citation><date>1983-01-21</date><url>https://www.courtlistener.com/opinion/1333232/walker-v-mitchell/</url><abstract> .&#x202F;.&#x202F;. 299 S.E.2d 698 (1983) .&#x202F;.&#x202F;. </abstract><court_html><abbr title="Supreme Court of Virginia">SCV</abbr></court_html></item></court_decisions></metadata></law>
