Any police officer may detain any person who he deems to be a necessary witness to a crime; provided, however, within 24 hours, including Sundays and holidays, he shall be brought before a justice of the superior court who may, upon the showing that the testimony of said person is necessary in any court, release the person on personal recognizance or take the recognizance of the witness in such sum as the justice may deem reasonable for his appearance before the court.
N.H. Rev. Stat. Ann. § 597:22
Recognizances After Arrest
Source
Official source: New Hampshire General Court. Reproduced from public-domain New Hampshire statutes; confirm against the official source for the current text. Not legal advice.