It is difficult to conceive how words could be more imperative in their character than those to be found in our statute of 1785. The judges named are authorized and required, either in vacation or term time, upon the due application of any person committed or detained for any criminal or supposed criminal matter, except for treason or felony, or confined or restrained of his or her liberty, under any color or pretence whatsoever, to award and grant a habeas corpus, directed to the person or persons in whose custody the prisoner is detained, returnable immediately. And the refusal or neglect to grant the writ required by the act to be granted, renders the judge so neglecting or refusing liable to the penalty of three hundred pounds.

I suppose no one will doubt the power of the legislature to require this writ to be issued by the judges of the commonwealth. And it is tolerably plain that where, in express words, a certain thing is directed to be done, to which is added a penalty for not doing it, no discretion is to be used in obeying the mandate.

The English statute confined the penalty to a neglect or refusal to grant the writ in vacation time, and from this a discretionary power to refuse it in term time was inferred, but our act of Assembly does not limit the penalty to a refusal in vacation, but is sufficiently comprehensive to embrace neglect or refusal in vacation or in term time.

I have looked in vain through the numerous cases reported in this State to find that the writ was ever denied to one whose application was in due form, and whose case was within the purview of the act of Assembly.

In Respublica v. Arnold, 3 Yates, 263, the writ was refused because the petitioner was not restrained of his liberty, and therefore not within the terms of the statute; and in Ex parte Lawrence, 5 Binney, 304, it was held that the act of Assembly did not oblige the court to grant a habeas corpus where the case had already been heard upon the same evidence by another court. Without going into an examination of the numerous cases where the writ has been allowed, I believe it can be safely affirmed that the denial of the writ in a case like the present is without a precedent, and contrary to the uniform practice of the bench, and against the universal understanding of the profession and the people; but what is worse still, it appears to me to be in direct violation of the law itself.

It may be said that the law never requires a useless thing to be done. Grant it. But how can it be determined to be useless until the case is heard? Whether there is ground for the writ is to be determined according to law, and the law requires that the determination should follow, not precede the return.

An application was made to the chief justice of this court for a writ of habeas corpus previous to the application now being considered. The writ was refused, and it was stated in the opinion that the counsel for the petitioner waived the right to the writ, or did not desire it to be issued, if the chief justice should be of the opinion that there was not sufficient cause set forth in the petition for the prisoner’s discharge. But this can in nowise prejudice the petitioner’s right to the writ which he now demands. Even had the writ been awarded, and the case heard, and the discharge refused, it would not be within the decision in Ex parte Lawrence, for there the hearing was before a court in term time, upon a full examination of the case upon evidence adduced, and not at chambers; but the more obvious distinction here is that the writ has never been awarded. And the agreement of counsel that it should not be in a certain event, even if binding upon the client there, would not affect him here.

Now, while I aver that the writ of habeas corpus, ad subjiciendum, is a writ of right, I do not wish to be understood that it should issue as a matter of course. Undoubtedly the petition must be in due form, and it must show upon its face that the petitioner is entitled to relief. It may be refused if, upon the application itself, it appears that, if admitted to be true, the applicant is not entitled to relief; but where, as in the case before us, the petition alleges an illegal restraint of the petitioner’s liberty, under an order from a judge beyond his jurisdiction, we are bound in the first place to take the allegation as true; and so taking it, a probable cause is made out, and there is no longer a discretionary power to refuse the writ. Whether the allegation of the want of jurisdiction is true or not, is determinable only upon the return of the writ.

If one has averred in his petition what, if true, would afford him relief, it is his constitutional right to be present when the truth of his allegations is inquired into; and it is also his undoubted right, under our habeas corpus act, to establish his allegations by evidence to be introduced and heard upon the return of the writ. To deny him the writ is virtually to condemn him unheard; and as I can see nothing in this case which requires at our hands an extraordinary resistance against the prayer of the petitioner to show that his imprisonment is illegal, that he is deprived of his liberty without due course of law. I am in favor of treating him as like cases have uniformly been treated in this commonwealth, by awarding the writ of habeas corpus, and reserving the inquiry as to his right to be discharged until the return of the writ; but as a majority of my brethren have come to a different conclusion, we must inquire next into the right of the applicant to be discharged as the case is now presented.

I suppose it to be undoubted law that in a case where a court acting beyond its jurisdiction has committed a person to prison, the prisoner, under our habeas corpus act, is entitled to his discharge, and that it makes no difference whether the court thus transcending its jurisdiction assumes to act as a court of the Union or of the commonwealth. If a principle, apparently so just and clear, needs for its support adjudicated cases, reference can be had to Wise v. Withers, 3 Cranch, 331; 1 Peters, Condensed Rep. 552; Rose v. Hinely, 4 Cranch, 241, 268; Den v. Harden, 1 Paine, Rep. 55, 58 and 59; 3 Cranch, 448; Bollman v. Swartout, 4 Cranch, 75; Kearney’s case, 7 Wheaton, 38; Kemp v. Kennedy, 1 Peters, C. C. Rep. 36; Wickes v. Calk, 5 Har. and J. 42; Griffith v. Frazier, 8 Cranch, 9; Com. v. Smith, Sup. Court Penn., 1 Wharton Digest, 321; Com. ex relatione Lockington v. The Jailer, &c., Sup. Court manuscript, 1814, Wharton’s Digest, vol. i. 321; Albec v. Ward, 8 Mass. 86.