If any warrant of arrest for a misdemeanor or felony, or any search warrant, is issued or procured at the instance of a prosecutor, other than a public officer charged with the enforcement of the laws, and the warrant is dismissed or the accused discharged from the charge or charges, the judge before whom the proceeding is held may give judgment against the prosecutor in favor of the accused for his costs. If the judge believes from the evidence that the warrant was procured by the prosecutor through malice or without reasonable and probable cause, the judge shall grant judgment in favor of the accused for his costs.
Va. Code § 17.1-280