If any person is imprisoned, restrained of his liberty or held in duress, unless by a lawful writ, warrant or other process, civil or criminal, he may have the writ for replevying the person, on complaint filed by himself or anyone in his behalf in the Superior Court, at the discretion of the court and not otherwise.
14 M.R.S. § 7351