Cope, C. J. delivered the opinion of the Court—Norton, J. concurring specially.
A petition having been presented to us, stating that the petitioner, John R. Corryell, was unlawfully restrained of his liberty by the Sheriff of the County of San Francisco, a writ of habeas corpus was issued, to the end that the cause of his restraint might be inquired into, and its legality or illegality determined. In obedience to this writ, the petitioner has been brought before us, and the return of the Sheriff shows that he is in custody by virtue of an order of the Court of Sessions of San Francisco County, committing him for trial on an indictment found by the Grand Jury of the county, charging him with altering and falsifying a document and record belonging to a public office in this State. The indictment charges that the document altered was the engrossed copy of a bill introduced into the Senate of the State at its session of 1861, and that at the time of its alteration it was a public record belonging to the office of the Secretary of State.
The counsel for the petitioner contends that no offense punishable by law is charged in the indictment, and that consequently the order or commitment under which he is held is illegal and void. It is objected on the other side, that the present is not a proper proceeding for the determination of that question; that the commitment emanated from a Court of competent jurisdiction, and that its action in the premises is not subject to review on habeas corpus. Considerations of great importance are involved in this objection, and although we are compelled to overrule it as applied to a case of illegal imprisonment, we find it extremely difficult to lay down a rule under which abuses may not be practiced, and the business of *181the Courts improperly interfered with. The vice of the objection is that it assumes that the Court had jurisdiction, whereas the fact of jurisdiction is the very fact which the petitioner disputes, alleging that the offense charged is one not known to the law. The Court derives its jurisdiction from the law, and its jurisdiction extends to such matters as the law declares to be criminal, and none other, and when it undertakes to imprison for an offense to which no criminality is attached, it acts beyond its jurisdiction. It has never been doubted that the fact of jurisdiction was a proper subject of inquiry in a proceeding of this character, and if such were not the case, the simple warrant of a Court, however arbitrary and illegal it might be, would constitute a complete answer to the writ. It is said that the Court before which a case is pending is the proper tribunal to decide the questions arising in it, and that'no Judge or other Court can interfere by a collateral proceeding and impeach its action. This, as a general rule, is undoubtedly correct, but it is not correct in cases of imprisonment, where the remedy by habeas corpus is expressly provided to determine its legality, which, if it be a remedy at all, carries with it the power of relief. The remedy extends of course, only so far as to relieve the party from imprisonment, if he be illegally detained; but it certainly does extend that far, and it is the duty of the Court or Judge issuing the writ to investigate the cause of the detention and determine whether it is illegal or not. This duty is plainly enjoined by the statute, and in respect to an imprisonment under the order or commitment of a Court, the writ, although a collateral proceeding, performs to some extent the functions of a writ of review. The statute provides that “ If it appear on the return of the writ of habeas corpus that the prisoner is in custody by virtue of process from any Court of this State, or Judge or officer thereof, such prisoner may be discharged in any one of the following cases,” etc. Among the cases enumerated are these: “ When the jurisdiction of such Court or officer has been exceeded;” and “ When the process, though proper in form, has been issued in a case not allowed by law.” It is impossible to give effect to these provisions except by the exercise of a revisory power over the tribunal imposing the imprisonment, and the authorities all agree that the jurisdiction *182conferred by the writ is appellate in its nature. “ The decision that the individual shall be imprisoned,” says Hurd, “ must always precede the application for a writ of habeas corpus; and this writ must always be for the purpose of revising that decision.” He characterizes the'jurisdiction as appellate, and says: “ The phrase appellate jurisdiction does not necessarily import a subordination of one Court or officer to another, although that is its more usual signification. It may signify the power to act judicially upon a question or right, notwithstanding a supposed conclusion against it, resulting from an alleged judgment; and this is its true signification as applied to the writ of habeas corpus. It is not, strictly speaking, a power of revision, which includes properly the power to affirm or reverse the judgment, and so establish or destroy it, but a power to arrest the execution of a void judgment or order. It acts directly on the effect of the judgment, to wit, the imprisonment ; but only collaterally on the judgment itself.” (Hurd on Habeas Corpus, 330.) As to the extent of the jurisdiction, the same author says: “ The jurisdiction over the process being only collaterally appellate, the habeas corpus, as before intimated, cannot have the force and operation of a writ of error or a certiorari, nor is it designed as a substitute for either. It does not, like them, deal with errors or irregularities which render a proceeding voidable only, but with those radical defects which render it absolutely void.” (Id. 332.) This is the settled rule in such cases; a proceeding defective for irregularity and one void for illegality may be reversed on appeal; but the latter defect only authorizes a discharge on habeas corpus. The process must be void and not merely voidable, and when the cause of commitment is shown, if it appear that the Court issuing the process is a Court of competent jurisdiction, and that its jurisdiction has not been illegally asserted, the writ has performed its office. If it appear, however, that the process was issued in a case not allowed by law, and in which, therefore, the Court had no jurisdiction to commit, the prisoner may claim his discharge as a matter of right. Such, according to the argument of the counsel for the petitioner, is the case now before us; and if this be so, the imprisonment is illegal, and the petitioner must be released.
*183The indictment must be incorporated in and constitutes a part of the order of commitment, and the questions presented are such as arise upon the face of the process. The proposition, broadly stated, is that the prisoner has been guilty of no crime; that the alteration of the document mentioned in the indictment was not an offense punishable by law. The Act concerning Crimes and Punishments (Sec. 87) provides, that any person who shall alter, deface, or falsify any minute, document, book, or any proceeding whatever, of or belonging to any public office in this State, shall upon conviction be punished, etc. The indictment, as we have already remarked, charges that the document in question, being the engrossed copy of a certain Senate bill, was a document belonging at the time of its alteration to the office of the Secretary of State. If this be true, there is no doubt that the indictment charges an offense within the meaning of the statute, and the matter resolves itself into a mere inquiry as to whether the document was or was not a document belonging to the office named. It was a part of the proceedings of the Senate at its session of 1861, and the question is whether there was any law transferring it to the custody of the Secretary of State, and requiring it to be kept in his office. An act passed on the fifteenth of May, 1854, provides that “ the Secretary of State shall have the custody of, and shall carefully preserve, the enrolled copy of the Constitution of the State of California; the description of the State seal, and other seals of which a description may be required to be deposited in his office; the manuscripts containing the enrolled acts and joint resolutions and journals of the Legislature; and all the books, records, parchments, maps, registers, and papers that may be required to be deposited in his office.” The only legislative documents referred to in this act are the manuscripts of enrolled acts, of joint resolutions and of the journals; and it is not pretended that its provisions can be so construed as to include engrossed bills. It applies, however, to all papers, records, etc., which may be required to be deposited in that office; and it is contended that by a subsequent act engossed bills are required to be so deposited. The act alluded to was passed in 1861, on the last day of the session of that year, and provides that “ the Secretary and Assist*184ant Secretary of the Senate, and the Chief Clerk arid Assistant Clerk of the Assembly, at the close of each session of the Legislature, shall mark, label, and arrange all bills and papers belonging to the archives of their respective houses, and deliver the same, together with all books of both houses, to the Secretary of State.” It is entitled “An Act fixing the number of Officers and Employés of the Senate and Assembly, to define their Duties and establish their Pay;” and we are of opinion that its application was intended to be limited to future sessions. If such were not the intention with reference to the provision referred to, it is unfortunate that a contrary intention has not been expressed; but it certainly has not been, and we must take the act as we find it. It provides for the election of certain officers, and defines their duties, and it is upon these officers that the duties are imposed; and there is no provision referring to the officers of that session, nor did the act take effect until the expiration of sixty days after its termination. It is clear, therefore, that the act is limited in its operation to subsequent sessions ; and the result is that there was no law requiring the document in question to be deposited in the office of the Secretary of State.
The only further question is,-whether the prisoner should be held to answer the charge of altering the document as belonging to the office of the Secretary of the Senate. We are unable to find any law requiring documents of this description to be preserved in that office, and prior to the Act of 1861 no provision for keeping them after the close of the session seems to have existed. They appear to have been regarded as papers which had served them purpose, and become functus officio.
We are of opinion that the prisoner should be discharged, and it is so ordered.
Norton, J.
I agree that the process by which the defendant is held does not show that he has committed any offense known to the law at the time of the commission of the offense as charged, and that he should be discharged from custody. I may hereafter write an opinion more fully expressing my views in this case.