Eelator was indicted May 5, 1908, for assault in the first degree. He pleaded guilty. Thereafter the court received evidence that relator had been previously convicted of felony on two occasions, once in Wisconsin and once in Minnesota. The maximum punishment for assault in the first degree was ten years in the penitentiary. E. L. 1905, § 4903 (G. S. 1913, § 8631). Another statute, E. L. 1905, § 4772 (G. S. 1913, § 8491), provided that any person convicted of a felony punishable by imprisonment for a term less than life, if previously convicted in this state of a felony, or in another state of a crime which if committed in this, state would be a felony, should be sentenced for a term not less than the *296maximum, nor more tlian twice the maximum, prescribed for a first conviction.
Acting under this statute the trial court sentenced relator to a term of 18 years in the penitentiary. The conduct of relator has been such that, if his sentence had been ten years, it would have ended in May, 1915. He sues out this writ of habeas corpus claiming his right to release.
It is conceded that the sentence for 18 years was erroneous. It is settled in this state in accordance with the great weight of authority that, in order to warrant the imposition of the increased punishment upon second offenders, the prior conviction must be charged in the indictment and also established on the trial, if there be a trial, and a verdict of the jury rendered thereon. State v. Findling, 123 Minn. 413, 144 N. W. 142. The former convictions were not charged in the indictment in this case.
In order to secure release on habeas corpus it is not enough for the relator to show that the judgment or sentence under which he is held was erroneous. The writ of habeas corpus may not be prosecuted by any person imprisoned by virtue of the final judgment of any competent tribunal (G. S. 1913 § 8283 1), even though the judgment is tainted with error. Sennott’s Case, 146 Mass. 489, 16 N. E. 448, 4 Am. St. 344; United States v. Pridgeon, 153 U. S. 48, 62, 14 Sup. Ct. 746, 38 L. ed. 631. In such case the prisoner is put to his right of appeal or writ of error. In order to secure release on habeas corpus it must be made to appear that the judgment is void. State v. Kinmore, 54 Minn. 135, 55 N. W. 830, 40 Am. St. 305; State v. Billings, 55 Minn. 467, 57 N. W. 206, 794, 43 Am. St. 525. The judgment is void if the court was without jurisdiction to render it, for a court without jurisdiction is not a “competent tribunal,” within the meaning of the habeas corpus statute. State v. West, 42 Minn. 147, 43 N. W. 845; State v. Kinmore, 54 Minn. 135, 55 N. W. 830, 40 Am. St. 305; State v. Wagener, 74 Minn. 518, 77 N. W. 424, 42 L.R.A. 749, 73 Am. St. 369; State v. Justus, 85 Minn. 114, 88 N. W. 415; 56 L.R.A. 757, 89 Am. St. 550. A party held only by virtue of a judgment void for want of jurisdiction, is not put to his right of appeal or writ of error, but may be released on habeas corpus. *297People v. Liscomb, 60 N. Y. 559, 19 Am. Rep. 211, quoted in State v. Billings, 55 Minn. 467, 470, 57 N. W. 206, 794, 43 Am. St. 525.
In this ease the court imposing the sentence had jurisdiction of the person of the relator and of the subject matter of the cause. It was a court of general jurisdiction. But a court of general jurisdiction, having jurisdiction of the cause and of the parties, may not have power to enter the particular judgment that it did enter. Jurisdiction is the power to hear and determine, but it involves also the power to give the judgment that is entered. In re Bonner, 151 U. S. 242, 257, 14 Sup. Ct. 323, 38 L. ed. 149. Even though a court has jurisdiction of the offense and the person, it may so far transcend its power in assessing the penalty that the sentence will be void. A court of general jurisdiction cannot give a judgment contrary to law or not authorized by law.
Even in civil cases, barring cases of litigation by consent, a judgment for relief beyond the issues is “not within the power of the court,” and may be collaterally impeached, for although suitors have submitted certain of their disputes to the decision of the court, the tribunal is not thereby authorized to decide other matters in controversy between the parties not involved in the pending litigation. Sache v. Wallace, 101 Minn. 169, 112 N. W. 386, 11 L.R.A. (N. S.) 803, 118 Am. St. 612, 11 Ann. Cas. 348; Iltis v. Greengard Bros. 109 Minn. 208, 123 N. W. 406; Bombolis v. Minneapolis & St. L. R. Co. 128 Minn. 112, 117, 150 N. W. 385.
In criminal cases it is the rule established by all the authorities that the jurisdiction of the court to impose sentence is limited to the sentence prescribed by statute for the offense charged in the indictment. Some courts have held that a sentence in excess of the statutory limits renders the whole sentence void. Ex parte Page, 49 Mo. 291; Ex parte Baldwin, 60 Cal. 432; Church, Hab. Corpus, § 373. The prevailing rule now is that such a sentence is valid except as to the excess which the statute does not authorize, but that as to such excess it is void (Ex parte Lange, 18 Wall. 163, 176; 21 L. ed. 872; United States v. Peeke, 153 Fed. 166, 82 C. C. A. 340, 12 L.R.A. (N.S.) 314; In re Bonner, 151 U. S. 242, 258, 14 Sup. Ct. 323, 38 L. ed. 149; United States v. Pridgeon, 153 U. S. 48, 14 Sup. Ct. 746, 38 L. ed. 631; In re Paschal, 56 Kan. 123, 42 Pac. 373; People v. Liscomb, 60 N. Y. 559, 19 Am. Rep. 211; People v. Baker, 89 *298N. Y. 460; Ex parte Van Hagan, 25 Oh. St. 426, 432; Ex parte Mooney, 26 W. Va. 36, 53 Am. Rep. 59; see also State v. Wolfer, 68 Minn. 465, 71 N. W. 681); and the recognized practice in such cases is that after the expiration of the lawful term “the court will order the prisoner’s discharge, but until then he has no right to ask the annulment of the entire judgment.” Field, J. in In re Graham, 138 U. S. 461, 11 Sup. Ct. 363, 34 L. ed. 1051.
Petitioner ordered discharged.
[R. L. 1905, § 4573.]