In any case in which a person charged with a misdemeanor or felony, or a juvenile taken into custody pursuant to § 16.1-246 is held in some county, city or town other than that in which he is to be tried upon such charge, he may be admitted to bail by any judicial officer of the county, city or town in which he is so held in accordance with the provisions of law concerning the granting of bail in cases in which persons are so admitted to bail, when held in the county, city or town in which they are to be tried.
In such case, such judicial officer before whom he is brought may, without trial or examination, let him to bail, upon taking a recognizance for his appearance before the court having cognizance of the case. The fact of taking such recognizance shall be certified by the court or officer taking it upon the warrant under which such person was arrested or taken into custody and the warrant and recognizance shall be returned forthwith to the clerk of the court before whom the accused or juvenile taken into custody pursuant to § 16.1-246 is to appear. And to such court, the judicial officer who issued such warrant shall recognize or cause to be summoned such witnesses as he may think proper.
Va. Code § 19.2-131