Any person 18 years of age or older, including the parent of any child, who (i) willfully contributes to, encourages, or causes any act, omission, or condition that renders a child delinquent, in need of services, in need of supervision, or abused or neglected as defined in § 16.1-228 or (ii) engages in consensual sexual intercourse or anal intercourse with or performs cunnilingus, fellatio, or anilingus upon or by a child 15 or older not his spouse, child, or grandchild is guilty of a Class 1 misdemeanor. This section shall not be construed as repealing, modifying, or in any way affecting §§ 18.2-18, 18.2-19, 18.2-61, 18.2-63, and 18.2-347.
If the prosecution under this section is based solely on the accused parent having left the child at a hospital or emergency medical services agency, it shall be an affirmative defense to prosecution of a parent under this section that such parent safely delivered the child within the first 30 days of the child's life to (a) a hospital that provides 24-hour emergency services, (b) an attended emergency medical services agency that employs emergency medical services personnel, or (c) a newborn safety device located at and operated by such hospital or emergency medical services agency. In order for the affirmative defense to apply, the child shall be delivered in a manner reasonably calculated to ensure the child's safety.
Va. Code § 18.2-371