If any person shall be committed for a criminal or supposed criminal matter and not admitted to bail, and shall not be tried on or before the second term of the court having jurisdiction of the offense, the prisoner shall be set at liberty by the court, unless the delay shall happen on the application of the prisoner. If such court at the second term shall be satisfied that due exertions have been made to procure the evidence for and on behalf of the state, and that there are reasonable grounds to believe that such evidence may be procured at the third term, it shall have power to continue such case until the third term. If any such prisoner shall have been admitted to bail for a crime other than a capital offense, the court may continue the trial of said cause to a third term, if it shall appear by oath or affirmation that the witnesses for the state are absent, such witnesses being mentioned by name, and the court shown wherein their testimony is material.
N.D.C.C. § 32-22-34