If an offense which the court is without jurisdiction to try was committed within the jurisdiction of another county of this state, the court may direct the defendant to be committed for such time as it deems reasonable to await a warrant from the proper county for the defendant's arrest, or if the offense is a misdemeanor or an infraction, it may admit the defendant to bail in an undertaking, with sufficient sureties, that the defendant, within such time as the court may appoint, will submit to a warrant for the defendant's arrest from the proper county, and if not sooner arrested thereon, will attend at the office of the sheriff of the county where the trial was had, at a time particularly specified in the undertaking, to submit to the warrant if issued, or that the defendant's bail will forfeit such sum as the court may fix, and to be mentioned in the undertaking.
N.D.C.C. § 29-21-21