delivered the opinion of the court. The defendant in the original action was hound to plead his discharge, if he wished to avail himself of his exemption from imprisonment for the same cause, secured to him by the statute. If he had been convicted of perjury in procuring his discharge, he was, notwithstanding his discharge, liable to be again imprisoned, either on the old judgment, or under a new judgment recovered upon the old one, in an action of debt; and if the discharge had been pleaded, the plaintiff might have replied to it such conviction, which would have been conclusive to bar him of his exemption. The privilege from imprisonment to which' Brown was entitled under the statute, certainly might be waived, and the omission to plead the discharge in proper time was a waiver.
The judgment was regular, both in form and substance, and authorized the execution that was issued upon it, and which would have been a complete justification to the sheriff, in case he had been sued for false- imprisonment. There is no pretence for saying that either the judgment or execution was void, and admitting they were voidable, that is a point which the sheriff is not permitted to raise, and with which he has no concern. The sheriff is never allowed to allege error either in the judgment or process, as an excuse for an escape; and if he arrests the party, he is bound to keep him until he is discharged by due course of law. To these points, the cases cited by the counsel for the plaintiff are full and decisive, particularly the two cases of Reynolds
The next question is, whether the commissioner had a right to discharge him, and if he had no such right, yet, having actually discharged him, whether such discharge is a defence against this suit. It may well be doubted whether the statute gives to a judge or the chancellor, in vacation, a right to discharge a party imprisoned on civil process. If it were necessary to decide that question in this case, and for the first time, I should say it does not. (Ex parte Wilson, 6 Cranch, 52.) But admitting it to be settled, that the statute extends to cases of illegal imprisonment under civil, as well as criminal process, yet the power of the officers to whom the execution of it is committed, is special and circumscribed, and they are prohibited from granting a discharge whenever the party is “ in execution by legal process.” If these officers exceed their powers, or, in other words, if they discharge when they have no jurisdiction, their acts are void. If Brown was in execution by legal process, (and of which thére cannot be the least doubt,) it necessarily follows, that the commissioner had no authority to discharge him. It was upon this ground that this court decided that the discharge of Mr. Yates, under the habeas corpus act, was void. Much as I respect the commissioner who granted this discharge, it was, beyond all doubt, an interference wholly unauthorized. He had no power to declare either the execution or judgment void. He had no discretion in this case ; for, according to the clear and unequivocal words of the statute, the moment he discovered that the prisoner was in custody on a ca. sa. perfectly valid and regular, upon the face of it, his power to discharge him ceased, to all intents and purposes. The statute is peremptory, and he had nothing to do but to remand him. If this court, on motion, would not have set aside the judgment and. ca, sa. for any other purpose than to give the prisoner an opportunity to plead his discharge, how much more unauthorized was it for the commissioner to discharge him from custody, while both were in full force. The necessary consequence of these principles is, that the discharge