
124 N.W.2d 179 (1963)
STATE of South Dakota ex rel. Robert W. BARNES, Plaintiff and Appellant,
v.
Lawrence G. BEHAN, Superintendent of the Yankton State Hospital, Defendant and Respondent.
No. 10071.
Supreme Court of South Dakota.
October 23, 1963.
*180 Ramon A. Roubideaux, Fort Pierre, for plaintiff and appellant.
Frank L. Farrar, Atty. Gen., Gerald L. Reade, Asst. Atty. Gen., Pierre, for defendant and respondent.
BIEGELMEIER, Judge.
From the meager record in this habeas corpus proceeding, it appears on March 26, 1962 Robert Barnes attempted to kill his former wife and did kill a man with whom she had been associating. Tried for murder, a jury returned a verdict of "not guilty by reason of insanity" on October 3, 1962. SDC 1960 Supp. 34.3672 provides:
"If the defense involves the sanity of the defendant when the alleged crime was committed, the jurors must be instructed, if they acquit him on the ground of insanity at that time, to state the fact in their verdict. The Court may thereupon, if the defendant is in custody and it deems his discharge dangerous to the public peace or safety, order him to be committed to a State Hospital for the Insane until he becomes sane."
The circuit court of Pennington County entered an order "based upon the evidence presented in the case, the court deeming that defendant's discharge would be dangerous to the public peace or safety, ORDERED, That the defendant, Robert W. Barnes, be forthwith committed to and he is hereby committed to the State Hospital for the Insane at Yankton, South Dakota, until such time as said defendant becomes sane, and until he no longer constitutes a danger to himself or to society or any member thereof, upon determination by a court of competent jurisdiction." Being confined to the hospital under the direction of defendant Behan as superintendent, in December 1962, Barnes applied to a judge of the First Judicial Circuit wherein the hospital is located for a writ of habeas corpus. See SDC 30.0111 and SDC 1960 Supp. 37.55. After a hearing the writ was quashed and Barnes remanded to the defendant's custody pursuant to the above order of commitment. He appeals.
At the murder trial Dr. Behan, as a witness for the state testified in his opinion that at the time of the homicide Barnes was non-psychotic; the jury as heretofore related rejected this testimony and adopted the evidence of Barnes' witnesses that he was insane. At the habeas corpus hearing, Barnes called defendant Behan who testified he was still of the same opinion, that is, Barnes was sane. At this hearing Barnes was a witness in his own behalf. None of his medical history or state hospital record was disclosed; Dr. Forsyth, who was in charge of his ward the bulk of the time, did not testify and it did not appear Dr. Behan had seen him since the trial.
The mental capacity and reason to distinguish between right and wrong, and to know that the particular act being committed is wrong, is the recognized rule in this jurisdiction of testing criminal responsibility. It is the only test of sanity or insanity that was involved in the murder trial and is in substance the "right and wrong" test established in the McNaghten Case, 8 English Reprint 718. See also SDC 13.0201 and State v. Violett, S.D., 111 N.W.2d 598, 606. The testimony of Dr. Behan at that trial and the habeas corpus hearing was necessarily directed to, and limited by that test; indeed, there was no basis for it other than his earlier opinion at the murder trial. He did testify Barnes *181 had a passive aggressive personality, which he stated is a type where persons have a basic hostility underneath which they handle in a passive way, but have occasional outbursts in which they can become quite aggressive and that Barnes is still potentially dangerous to his wife and persons with whom she might associate or contemplate marriage.
An accused acquitted by reason of insanity is presumed to be insane. Orencia v. Overholser, 1947, 82 U.S.App. D.C. 285, 163 F.2d 763. This presumption goes beyond the familiar principle that a condition of insanity once established is presumed to continue. Overholser v. De Marcos, 1945, 80 U.S.App.D.C. 91, 149 F.2d 23. The reach of SDC 1960 Supp. 34.3672 is not whether a person, engaged in the ordinary pursuits of life, is committable to a mental institution under the laws governing civil commitments. This statute applies to an exceptional class of persons who have committed acts forbidden by lawin this case an act of violence, a homicideand obtained a jury verdict of "not guilty by reason of insanity" and then found by the trial judge to be dangerous to the public peace and safety if left at large. To obtain a release from the commitment, the patient must show freedom from such abnormal mental condition as would make him dangerous to himself or the community. After such an adjudication the burden of this showing rests on him. Even where the preponderance of the evidence favors the petitioner, the doubt, if a reasonable doubt exists about danger to the public or the individual, cannot be resolved so as to risk danger to the public or the individual. A patient may have improved materially and appear to be a good prospect for restoration as a useful member of society, but, if an "abnormal mental condition" renders him potentially dangerous, reasonable medical doubts and reasonable judicial doubts are to be resolved in favor of the public and in favor of the patient's safety. Ragsdale v. Overholser, 108 U.S.App.D.C. 308, 218 F.2d 943. The evidence must be such as to make the court reasonably certain the patient has been restored to mental health before a discharge from custody should be granted. Orencia v. Overholser, supra.
The rule that inquiry into the sanity of an accused before trial or after conviction is entirely distinct from the proceedings on a plea of not guilty by reason of insanity (State v. Violett, supra) also applies to such inquiry after a verdict of not guilty on such plea. In the Violett opinion this court quoted from People v. Field, 108 Cal.App.2d 496, 238 P.2d 1052, 1055, as follows:
"insanity which demands that a person shall be confined in a state hospital is not necessarily the same insanity which bars the prosecution of that person for the commission of a felony."
The fact petitioner was tried for his criminal acts was no indication he was sane for the reason an insane person may be tried if he is competent to understand the proceeding and conduct his defense in a rational manner. See Magenton v. State, 76 S.D. 512, 81 N.W.2d 894; SDC 1960 Supp. 34.20 and SDC 1960 Supp. 34.20A. For aught that appears in this record, appellant's harboring the ill will and dangerous intentions directed toward his first wife and anybody she might go with or contemplate marriage with in the future is a fixation or unsoundness of mind and derangement of the intellect of sufficient degree to require his continued commitment, yet it might not be sufficient defense to a criminal act.
A person found not guilty by reason of insanity of a crime of violence and committed to a hospital for the insane should not be released as sane if there is a reasonable probability that by reason of mental disease or unsoundness of mind he is a danger to himself, to his own safety, or a menace to the safety, person or property of other people. Salinger v. Superintendent, 206 Md. 623, 112 A.2d 907; State ex rel. Wyman v. Turk, 62 Ohio App. 227, 23 N.E.2d 644 and see State ex rel. Thompson *182 v. Snell, 46 Wash. 327, 89 P. 931, 9 L.R.A., N.S., 1191.[*]
Under this record it does not appear the trial court erred and the order appealed from is affirmed.
All the Judges concur.
NOTES
[*]  This subject has been discussed in 70 Yale L.J. 225, 940; 38. Tex.L.Rev. 847; 10 U.C.L.A.L.Rev. 408; 111 Pa.L.Rev. 389; 14 Syracuse L.Rev. 564; People v. Dubina, 304 Mich. 363, 8 N.W.2d 99, 145 A.L.R. 886 and United States v. Lawrence, 26 Fed.Cas. 887, No. 15,577, cited in Lynch v. Overholser, 369 U.S. 705, 82 S.Ct. 1063, 8 L.Ed.2d 211 (dissenting opinion), where the history and procedures in various jurisdictions are set out.
