If any person, except persons convicted of some crime or offense for which they stand committed, or persons committed for treason or felony, the punishment whereof is capital, plainly and specially expressed in the warrant of commitment, now is or shall be confined in any jail of this state, or shall be unlawfully deprived of his or her liberty, and shall make application, either by him or herself or by any person on his or her behalf, to any one of the judges of the district court, or to any county judge, and does at the same time produce to such judge a copy of the commitment or cause of detention of such person, or if the person so imprisoned or detained is imprisoned or detained without any legal authority, upon making the same appear to such judge, by oath or affirmation, it shall be his duty forthwith to allow a writ of habeas corpus, which writ shall be issued forthwith by the clerk of the district court, or by the county judge, as the case may require, under the seal of the court whereof the person allowing such writ is a judge, directed to the proper officer, person or persons who detains such prisoner.
Neb. Rev. Stat. §§ 29-2801