Duty of attorney for Commonwealth

Va. Code Ann. § 37.2-847, under Chapter 8. Emergency Custody and Voluntary and Involuntary Civil Admissions..

Va. Code Ann. § 37.2-847

In any case to test the legality of the detention of a person pursuant to this article, whether by habeas corpus or otherwise, the attorney for the Commonwealth of the county or city in which the hearing is held shall, on request of the director of the facility or other institution having or claiming custody of the person, represent the Commonwealth in opposition to any such petition, appeal, or procedure for the discharge of the person from custody.