If the offense charged in a warrant of arrest is a misdemeanor or infraction not within the jurisdiction of the magistrate who issued it to punish, and the accused is arrested in another county, the officer, upon request of the accused, shall take the accused before a magistrate in the county in which the arrest is made, who shall admit the accused to bail and take bail from the accused accordingly. If there is no magistrate residing within the county wherein the accused is arrested, and the accused requires it, the officer shall take the accused before a magistrate of any other county nearer or more accessible than the magistrate issuing the warrant, and said magistrate shall admit the accused to bail and take bail from the accused accordingly.
N.D.C.C. § 29-05-12