All persons charged with crime committed in the state, while awaiting indictment or trial on such charge, shall be incarcerated in the county jail of the county wherein such crime is alleged to have been committed or any facility operated by agreement between such counties or municipalities, except that such persons may be temporarily imprisoned in other places of confinement while being conveyed or awaiting conveyance to the jail of the proper county; provided that the sheriff or jail administrator of any county, having the custody of anyone charged with the commission of crime, shall be authorized to remove such person to another county jail or any other place of safety when in the opinion of the sheriff or jail administrator the life of such person or others is in imminent danger; provided further that this section shall not prevent a person being confined in a jail other than the one belonging to the county in which the crime charged is alleged to have been committed, when such person is confined in such other jail in consequence of having taken a change of venue to such other county.
NMS § 33-3-13