Notwithstanding any contrary provision of law, no agency of the Commonwealth as defined in § 8.01-385, political subdivision of the Commonwealth as defined in § 8.01-385, employee of either acting in his official capacity, or member of the Virginia National Guard or Virginia Defense Force, when such a member is serving in the Virginia National Guard or the Virginia Defense Force on official state duty, shall knowingly aid an agency of the armed forces of the United States in the detention of any citizen pursuant to 50 U.S.C. § 1541 as provided by the National Defense Authorization Act for Fiscal Year 2012 (P.L. 112-81, § 1021) if such aid would knowingly place any state agency, political subdivision, employee of such state agency or political subdivision, or aforementioned member of the Virginia National Guard or the Virginia Defense Force in violation of the United States Constitution, the Constitution of Virginia, any provision of the Code of Virginia, any act of the General Assembly, or any regulation of the Virginia Administrative Code.
The provisions of this section shall not apply to participation by state or local law enforcement or Virginia National Guard or Virginia Defense Force in joint task forces, partnerships, or other similar cooperative agreements with federal law enforcement as long as they are not for the purpose of participating in such detentions under § 1021 of the National Defense Authorization Act for Fiscal Year 2012.
Va. Code § 2.2-614.2:1