
123 N.W.2d 654 (1963)
STATE of South Dakota ex rel. Joseph John RUFFING, Petitioner and Respondent,
v.
G. Norton JAMESON, as the duly appointed, qualified and Acting Warden of the South Dakota State Penitentiary, Defendant and Appellant.
No. 10045.
Supreme Court of South Dakota.
October 9, 1963.
*655 A. C. Miller, Atty. Gen., Gerald L. Reade, Richard Hopewell, Asst. Attys. Gen., on the brief, Pierre, for defendant and appellant.
John R. McDowell, of Boyce, Murphy & McDowell, Sioux Falls, for petitioner and respondent.
BIEGELMEIER, Judge.
Petitioner Ruffing as defendant pled not guilty to an information filed in Gregory County of the Eleventh Judicial Circuit charging him with the crime of second degree rape of a female, not his wife, under 18 years of age, to wit, 16 years of age. In the ensuing trial, the trial judge gave the following instructions to the jury:

"8.
"A smaller crime than rape is provided for under another criminal law which makes it a crime for any person to commit an assault with the intent to commit rape. Our statute defines assault in the following language:
"An assault is any willful and unlawful attempt to offer, with force or violence, to do a corporal hurt to another.'
"The term corporal hurt means bodily harm. Intent is a condition of the mind which is generally not susceptible to direct proof. It is manifested by the circumstances attending the act.

"9.
"* * * However, if you have a reasonable doubt about whether or not penetration * * * necessary under instruction number 4 heretofore given has been shown, then you should consider whether or not the defendant at the time and place here charged committed an assault upon Triola Miller with the intent to commit rape, and if you believe beyond a reasonable doubt that he did so do, then you should find the defendant `guilty of assault with intent to commit rape.'"
On December 18, 1958 the jury returned a verdict finding Ruffing guilty of "assault with intent to commit rape," on which the court sentenced him to five years in the State Penitentiary. Later that day he was arraigned on an Information charging him with being an habitual criminal; Count 1 of this four-count Information stated he was on December 18, 1958, convicted of an assault with intent to commit rape. To this he entered his plea of "guilty"; the five-year sentence was vacated and he was sentenced to ten years imprisonment. On appeal, this court affirmed. State v. Ruffing, 78 S.D. 556, 105 N.W.2d 541. Some time thereafter, he applied to one of the judges of the second judicial circuit, wherein the penitentiary is situated, for a writ of habeas corpus. The hearing judge was of the opinion that there was a serious question whether the trial court had authority to enter the judgment on the verdict because assault is not a necessary element of rape of a female under 18 years, even though there was substantial evidence of assault. He held the sentence void and released petitioner.
Pertinent statutes (citations are as of time of the original trial) and decisions of this court will explain this ruling and the question presented. Second degree rape of a female under the age of 18 years as charged is punishable by a sentence not exceeding 20 years. SDC 13.2801 and SDC 13.2803. To be rape in the first degree, the female must be under 10 years of age, incapable, through lunacy or other unsoundness of mind, of giving legal consent, or *656 accomplished by force overcoming her resistance. SDC 13.2803.
SDC 13.2401 defines assault as:
"An assault is any willful and unlawful attempt or offer, with force or violence, to do a corporal hurt to another."
SDC 13.2303 declares:
"Every person who is guilty of an assault with intent to commit any felony, (rape) * * * is punishable by imprisonment in the State Penitentiary not exceeding five years."
By SDC 13.0401:
"Every person who attempts to commit any crime and in such attempt does any act toward the commission of such crime * * * is punishable (in the case of any attempted rape) * * * for a term not exceeding one-half the longest term of imprisonment prescribed upon a conviction for the offense so attempted."
SDC 34.3669 provides:
"The jury may find the defendant guilty of any offense, the commission of which is necessarily included in that with which he is charged in the indictment or information, or of an attempt to commit the offense charged."
Under this section a defendant charged with forcible rape may be properly convicted of the lesser offense of assault with intent to commit rape. State v. Crofutt, 76 S.D. 77, 72 N.W.2d 435. It was there said assault with intent to commit rape is not a degree of the crime of rape, but is a crime defined in SDC 13.2303, supra; that it was an offense necessarily included in the charge of forcible rape in the first degree and when requested, it was the duty of the trial court to so instruct the jury.
State v. Lutheran, 76 S.D. 561, 82 N.W.2d 507, decided an accused charged with rape may be convicted of an attempt to commit such crime, it being a necessarily included offense, under SDC 34.3669, supra.
In State v. Pepka, 72 S.D. 503, 37 N.W.2d 189, the information charged defendant with the crime of attempt to rape a female between 13 and 14 years of age under SDC 13.0401(1). The trial court refused to submit the crime of assault as an offense "necessarily included" therein. This court affirmed stating "the crime of assault as defined by our law (SDC 13.2401) is not an offense `necessarily included' in the crime" of attempt to commit rape.
Review of claims of error on appeal from a judgment sentencing a defendant or an order denying a new trial under SDC 34.4109 stand in a different posture than the review on habeas corpus. Habeas corpus cannot be utilized as a substitute for appeal. State ex rel. Smith v. Jameson, 70 S.D. 503, 19 N.W.2d 505; State ex rel. Medicine Horn v. Jameson, 78 S.D. 282, 100 N.W.2d 829. Errors and irregularities in the proceedings of a court having jurisdiction of the person, subject matter and power to decide questions of law, are not reviewable though they may have been grounds for reversal on direct appeal. Jurisdiction is the power to hear and determine a controversy and to render judgment in accord with law. Excepting those actions in which the court may lose jurisdiction by a denial of due process (see State ex rel. Baker v. Jameson, 72 S.D. 638, 38 N.W.2d 441) this power includes the power to decide wrongly as well as rightly, to render an erroneous judgment as well as a correct one. Yet jurisdiction is not thereby lost. Stated succinctly, the power to decide includes the power to err. Were it held a court had jurisdiction to render only correct decisions, then, each time it made an erroneous ruling or decision, the court would be without jurisdiction and the ruling itself void. Such is not the law. If error occur the remedy is by appeal. Calhoun v. Bryant, 28 S.D. 266, 133 N.W. 266; Hartman v. Home Owners' Loan Corp., 69 S.D. 160, 7 N.W.2d 720; and see State ex rel. Lay v. District Court, 122 Mont. 61, 198 P.2d 761, 768 and In re Rothrock's Estate, 173 Kan. 717, 252 P.2d 598.
*657 It is the duty of the trial judge to determine questions of law. SDC 34.3629. In so doing he makes rulings on evidence and pronouncements in his instructions to the jury and in entering judgment on the verdict. Cf. SDC 33.1701. Review of these determinations is wholly by appeal. The court in its instructions in the criminal action was called upon to decide the question of law whether the commission of the crime of assault with intent to commit rape was necessarily included in that which petitioner was then charged. The court determined it was and so instructed the jury. This instruction was binding on it and the parties and became the law of the case, City of Sioux Falls v. Ugland, S.D., 109 N.W.2d 144, subject to appropriate review. It is of no concern now if objections were or were not made to the instructions. Defendant could have done so then and raised the question on a motion for a new trial, SDC 34.40, or by appeal. Failure to do so in either the trial or appellate court is a waiver of the objection. State v. Rathjin, 46 S.D. 412, 193 N.W. 247, and see Bailey v. Henslee, 8 Cir., 1959, 264 F.2d 744, an opinion by Judge Gardner. This applies to any error claimed to have occurred prior to and including the sentence which he could have asserted in either court. The judgments have become final and res judicata so far as this petitioner is concerned. Ex parte Passarello, 93 Cal.App. 443, 269 P. 719.
The court in Ex parte Drennan, 33 Cal. App. 193, 164 P. 807, considering much the same question under similar statutes and prior decisions, wrote:
"The petitioner was convicted of, and is now undergoing punishment for, the crime of an assault to commit the crime of rape. He claims that the judgment of conviction was and is void, because the crime of which he was found guilty was not within the crime charged in the information. The point is that he was therein charged with statutory rape, or carnally knowing a female incapable under the law of consenting to such an act, in which case force is not a necessary element, and which, where committed even with the actual consent of the female, is, under the law, a crime, and that, therefore, an assault is not a necessary ingredient of the crime. He cites and relies on the case of People v. Akens, 25 Cal. App. 373, 143 P. 795."
After stating the record then before them disclosed the female protested defendant's conduct and warranted the finding of assault notwithstanding prosecutrix was under the age of consent, the court continued:
"Whether testimony showing that the crime charged or the attempt to commit said crime was accompanied by force and against the will of the prosecutrix was inadmissible under the information was not pointed out by the defendant when his case was before us on appeal. But whether it was or was not inadmissible is a question which cannot be reviewed or considered to any purpose in a proceeding on habeas corpus. The remedy for the correction of errors occurring in the course of the trial of a case, either criminal or civil, lies wholly in an appeal".
As appears from our statutes, by SDC 34.3669, defendant could have been found guilty of an attempt to commit second degree rape, punishment of which may be one-half the longest term of 20 years (SD C 13.0401)or 10 years. By the court's instruction the jury was permitted to, and did, find defendant guilty of assault with intent to commit rape under SDC 13.2303, which was punishable by a term not exceeding five years. Defendant was represented by two different lawyers; it may well have appeared to him and his counsel that defendant was benefiting from the instruction given by a five-year margin. Pointing out the claimed error then may have subjected defendant to a longer term, or prosecution for assault with intent to rape as it was not barred by the statute of limitations. SDC 34.0703. It now is barred.
*658 Defendant may not stand idly by and fail to object or call the court's attention to claimed errors at the proper time and then later by habeas corpus attempt to assert them.
In People ex rel. Wachowicz v. Martin, 293 N.Y. 361, 57 N.E.2d 53, 154 A.L.R. 1128, where the indictment was for burglary and concealing stolen property, defendant pled guilty to attempted grand larceny. That crime was not "necessarily included" in those with which he was charged as required by the New York Code, Code of Criminal Procedure, § 445, which is similar to our SDC 34.3669. Judge Lehman speaking for the court wrote:
"The relator was properly held to answer for the crime charged in the indictment. He sought and obtained the benefit that might accrue to him from a finding of guilt of a crime connected with the same transaction, though not necessarily included in the crime charged in the indictment. The court had jurisdiction to determine whether in those particular circumstances it was authorized to render a judgment which it was certainly competent to render in some circumstances. Its judgment was not a nullity and the defendant who asked the court to render an erroneous judgment in a pending judicial proceeding may not thereafter, when it suits his convenience, challenge the judgment by habeas corpus."
Errors in instructions, including those which erroneously instruct the jury that they might assess a lesser punishment than the law requires, have been held not to divest the court of jurisdiction; they are voidable only and cannot be corrected or questioned on habeas corpus. Ex parte Pike, 50 Okl.Cr. 125, 296 P. 529; Ex parte Newman, 67 Okl.Cr. 401, 94 P.2d 556; Garrison v. Hudspeth, 10 Cir., 108 F.2d 733; Truman v. Hann, 154 Neb. 501, 48 N.W.2d 418. The trial court may have committed error in the instruction but it was error within his jurisdiction and did not divest the court thereof. Ex parte Passarello, 93 Cal.App. 443, 269 P. 719, supra, and Nelson v. Cox, 66 N.M. 397, 349 P.2d 118.
The claimed error existed at the time of the trial and appeal and there should be an end to litigation. The situation is aptly put in Ex parte Herren, 74 Okl.Cr. 154, 124 P.2d 276:
"All of the matters and facts set forth in the petition herein, if true, existed at the time of the appeal. This court will not permit an accused to appeal his judgment of conviction and speculate upon his chances of securing a reversal and then, after the judgment of conviction is affirmed, come into court in a habeas corpus proceeding and raise the same or other grounds which might entitle the petitioner to a new trial or his release from custody. To do so would not be conducive to the efficient administration of our criminal laws. If this were not so, then a criminal case would never end, but after trial and conviction the court would be called upon to again try the issues by habeas corpus."
See also Harrison v. Amrine, 155 Kan. 186, 124 P.2d 202.
In our opinion the sentence was not void and cannot be assailed in this proceeding. Cf. Ex parte Passarello, supra, and State ex rel. Elms v. Brown, 149 Minn. 297, 183 N.W. 669. The order appealed from is reversed and the cause remanded to the circuit court with instructions to vacate its order granting the writ releasing and discharging petitioner from custody of defendant warden and to enter an order remanding petitioner to the custody of the warden pursuant to the sentence of December 18, 1958, Wangsness v. McAlpine, 47 S.D. 472, 199 N.W. 478.
All the Judges concur.
