Opinion by
Mr. Justice Roberts,William Bilberry stands confined for life under a sentence imposed for the brutal murder of his wife on April 4, 1952. In 1963, Bilberry sought a writ of habeas corpus, but the petition was denied without hearing. Since the case involves homicide, the appeal from the dismissal comes directly to us.1
The grounds upon which the petition builds deal with the petitioner’s sanity at crucial moments in the' conviction and sentencing chain. Because of this, a complete statement of the proceedings is required.
Five months after the murder, in open court and with two court appointed attorneys, petitioner-appellant entered a plea of guilty. The record reveals that the following dialogue occurred at the time the plea was taken: “The Court: Mr. Bilberry, the Court has before it an indictment at No. 1 June Term, in the Court of Oyer and Terminer, 1952, wherein you are charged in two counts, the first count charging murder and the second count charging manslaughter, what is your desire at this time? Mr. Bilberry: Guilty. The Court: Is it your desire to now enter a plea to the indictment? Mr. White : That is the defendant’s desire. The Court : And you are represented by Robert White and Gilbert Long? Mr. Bilberry : That is right.”
The court directed the reading of the indictment and the clerk concluded with the traditional question to the accused: “Bow say you, are you guilty in the manner and form as you stand indicted?” to which petitioner replied, “Guilty.” Petitioner subsequently *537signed the indictment which his attorneys also signed as witnesses.
A month after the plea, the conrt en banc heard testimony to determine the degree of guilt and to fix the penalty. Petitioner did not testify. The court filed its opinion one month after the hearing, fixing the degree of guilt at murder in the first degree and setting the penalty at life imprisonment. On that same day, petitioner appeared with counsel in open court and sentence was pronounced. No statement was made by petitioner and none was requested of him.
Petitioner was spared a sentence of death because the court en banc determined that his mental condition and history were a substantial mitigating factor.2
*538During the hearing at which testimony was taken to determine the degree of guilt, four physicians who examined petitioner while he was in custody placed his mental age between that of an 8 to 12 year old child. Three of these physicians were of the view that he knew right from wrong. A fourth physician, the only psychiatrist, expressed the opinion that petitioner was not normal when born, that he suffered from organic deterioration of his faculties, and that he possessed the capacity of an eight year old child and less responsibility than such a child. The psychiatrist further concluded that while petitioner knew what other people said was right or wrong, he had no self feeling of what was right or wrong.
The court, writing in support of its sentence, made these observations: “[Considering his history as we now know it, the fact that there could be no mercenary motive, he had nothing to gain but to end the nagging and berating of his wife, who was and had been suffering from depressive psychosis, cannot be overlooked and cast aside if human justice is to be conscientiously administered. The defendant’s act in killing his wife under such circumstances certainly substantiates the medical and psychiatric evidence before us. Mentally retarded and immature, an individual of constitutional psychopathic state and emotionally unstable, with no understanding of the difference between right and wrong within himself, choosing to rid himself of annoyance, real or imaginary, by killing his tormentor, where a normal individual with the power of reason would have found the reasonable solution to his problems.” (Emphasis supplied.)
*539In concluding, the court added: “Our observation of the defendant during these entire proceedings serves but to confirm our analysis as above set forth.”
Petitioner was transferred to Western Correctional Diagnostic and Classification Center, Pittsburgh, two weeks after the sentencing. Following a determination by the resident physician that petitioner was of unsound mind and unfit for penal discipline, the warden forwarded to the court an application for the appointment of a “commission in lunacy”. Shortly thereafter, the commission was appointed by the court and a commission report followed five days later.
The lunacy commission deemed the petitioner to be a schizophrenic-paranoid. Its report found: “He was directed by a voice to kill his wife. ‘Something came into my mind.’ Prior to the act the patient was hunting in the house for someone hiding in house. Today [he] has visual hallucination — seeing members of his family.” The commission determined petitioner to be insane and of criminal tendency. On the same day the report was filed with the court (January 8, 1953), the court ordered petitioner committed to Farview State Hospital, a mental institution. He was admitted on January 13, 1953, and remained until September 9, 1958, at which time he escaped.3
At Farview State Hospital a report was made on January 22, 1963, classifying petitioner’s illness as schizophrenia, paranoid type. An evaluation of petitioner’s mental status unequivocally concluded: “There is no doubt that at the time of commission of the crime he had lost his hold on reality and was driven to the act by his delusions with probably no thought of resisting impulse.”
*540Petitioner’s self-drawn habeas corpus petition raises several questions of constitutional significance. He contends that at the time of sentencing he was insane and that, therefore, the imposition of sentence was invalid. He urges that he was not able to assist his counsel at any stage of the proceedings because he was mentally ill, and, therefore, he was “forced” to plead guilty. Finally, he attacks the validity of his confession because it was procured while he was insane. Petitioner makes the additional contention that he was insane when he killed his wife and that, accordingly, he should not have been convicted.
In the court below and in this Court, the Commonwealth takes the position that the “defense” of insanity was presented and rejected by the sentencing court.4 Since no appeal was taken, the Commonwealth contends these issues cannot now be raised. Similarly, the court below, in rejecting the petition without a hearing, held that since petitioner was represented by counsel when he entered his plea, the issue of his legal sanity at the time the offense was committed has been determined and cannot be raised successfully in the present proceedings.
Our review of the petition and the entire record in the trial court satisfies us that the petition is non-frivolous, that it is not contradicted by the record, and that it raises material and substantial questions of fact which, if established, would entitle petitioner to a writ of habeas corpus. In such a situation a hearing is compelled. See Commonwealth ex rel. Wilson v. Rundle, 412 Pa. 109, 111, 194 A. 2d 143, 144 (1963).
*541In onr view, both tbe Commonwealth and tbe court below misconceive the import of tbe petition.5 We do not now deem it necessary to pass upon any of the issues bearing on tbe commission of tbe crime itself. We do, however, regard the issue of petitioner’s legal competency, at tbe time bis plea was given and at tbe time sentence was imposed, as an issue which must be adjudicated in these proceedings.
Our society has always entertained an abhorrence for convicting, sentencing or, in any way, proceeding penally against an accused who cannot comprehend his position before the court or who fails to meet the current legal standards of requisite mental competency. See, e.g., Commonwealth v. Moon, 383 Pa. 18, 117 A. 2d 96 (1955). Proceedings which violate this fundamental and imbedded notion of fairness simultaneously violate our constitutional guarantees of due process of law. And if the record shows a plea or sentence so fundamentally unfair that it amounts to a denial of due process of law, habeas corpus will lie. Commonwealth ex rel. Elliott v. Baldi, 373 Pa. 489, 494, 96 A. 2d 122, 124-25, cert. denied, 345 U.S. 976, 73 S. Ct. 1125 (1953). See also Thomas v. Cunningham, 313 F. 2d 934, 938 (4th Cir. 1963).
*542The failure of the court to make specific inquiry of petitioner6 to determine whether the plea was voluntarily and intelligently entered, coupled with the total medical history and especially the medical findings made by the sentencing court itself, lead us to the conclusion that the plea proceedings of September 5, 1952, may have been of no intelligible significance to this appellant-petitioner.
Having carefully reviewed the extensive record before us, we believe that the record presents a highly unusual factual situation. The trial court’s considered observations following the entry of the plea of guilty and the testimony received thereon indicate a conclusion inconsistent with competency. Further inquiry should therefore have been made to determine the propriety of the court’s prior acceptance of the plea of guilty.7 So, too, appropriate inquiry should have been directed to ascertaining petitioner’s competency at the time sentence was imposed.8
We are of the view that the record before us9 (including as it does the 1952 opinion of the court which *543supports, to a large extent, petitioner’s allegations) requires a determination as to whether or not petitioner was legally competent at certain crucial moments in his conviction and sentencing. Since the court below did not hold a hearing before dismissing the petition, we deem it in the best interests of proper judicial procedure to afford that court the opportunity to independently pass upon the validity of the plea and sentencing.
We therefore remand the record to the court10 below for a hearing11 to determine whether petitioner *544was, at the time he entered his plea, mentally ill within the definition of the applicable law, and was thus unable to comprehend his position as one accused of murder and to co-operate with his counsel in making a rational defense, and to determine whether petitioner was mentally ill at the time sentence was imposed. See Act of June 12, 1951, P. L. 533, §§342-44, as amended, 50 P.S. §1222-24 ;12 Act of June 12, 1951, P. L. 533, §102(11), as amended, 50 P.S. 1072(11); see Commonwealth v. Novak, 395 Pa. 199, 150 A. 2d 102 (1959) ; Commonwealth v. Moon, supra.
Should the court below determine that petitioner’s plea was not voluntarily and intelligently entered, it shall issue the writ and award a new trial.13 If the court should find the plea of guilty was properly entered and that the petitioner was legally competent when sentence was imposed, then the sentence shall remain and the petition shall be dismissed. Should the court below determine that only the act of sentencing was invalid,14 then the court shall vacate the original sentence and shall direct petitioner to appear for proper sentencing.15
*545The order below is vacated and the record is remanded for proceedings consonant with this opinion.
Act of May 25, 1951, P. L. 415, §7, 12 P.S. §1907; Act of June 24, 1895, P. L. 212, §7.4, as amended, 17 P.S. §191.4 (Supp. 1964).
The court considered, for example, a medical report from the United States Naval Hospital, Great Lakes, Illinois, dated May 22, 1944, and quoted from it as follows: “ ‘According to reliable outside sources this patient has always been a problem child. He was slow to walls; and talk, as a child he was afraid of the dark, and is enuretic to this date. He had temper tantrums as a child, and an uncontrollable temper. At the age of ten years he stabbed his sister in the back with a knife in a fit of rage. He had St. Vitus dance at the age of 12 years. The family was poor and the patient quit school in the sixth grade at the age of fifteen years to go to work in the coal mines. He was involved in a mine eave-in at the age of seventeen and his family doctor told him that he would eventually end up in a mental institution. Since that time the family have constantly reminded him of the fact. Since the age of seventeen years the patient has been a heavy drinker and he has been treated for acute alcoholism on several occasions. He has been arrested twice for disorderly conduct. He has been unable to retain a job, being fired for not being dependable, poor workmanship, or sleeping on the job. He is considered the “black sheep” of the family and his mother says he is “queer in the head”.
“ ‘At present all physical and laboratory tests are negative. Psychiatric examination reveals a dull, emotionally flattened male who has many complaints since childhood. He complains of a lump in his throat and at times is tense, nervous, apprehensive, worried, flushed and sweaty. His lips and fingers tremble as he talks. No psychotic manifestations are elicited.
*538“ ‘It is the opinion of the board that he is suffering from a profound personality disorder, constitutionally determined, which renders him unfit for service.’”
He was eventually captured, but the circumstances of his escape and return are not here material.
In reality, evidence of petitioner’s mental condition was presented to the court, not as a legal defense, but rather as a circumstance to be considered in fixing tbe degree of guilt and in mitigation of sentence.
We again find, it appropriate to urge the attitude which we proposed in Commonwealth ex rel. Goodfellow v. Rundle, 415 Pa. 528, 532 n.6, 204 A. 2d 446, 448 n.6 (1964). We are sympathetically aware that our trial courts are presently being inundated with petitions for writs of habeas corpus. Most of these are prisoner-drawn. They are usually typewritten, frequently handwritten, unfailingly lengthy and invariably repetitious. Vet these petitions, involving, as they do, questions of human liberty, should be read with an eye to ferreting out and perceiving the true gravamen contained in the petition. This does not suggest that every petition must be considered meritorious or as requiring a hearing. The suggestion is only that it is desirable to take pains to understand what is being alleged.
See The Mental Health Act of 1951, Act of June 12, P. L. 533, §342, as amended, 50 P.S. §1222. See also Act of March 31, 1860, P. L. 427, §67, 19 P.S. §1352.
The present situation is unlike the situation where there is no auestion of defendant’s awareness of his position. Compare Commonwealth ex rel. Barnosky v. Maroney, 414 Pa. 161, 199 A. 2d 424 (1964).
In answer to the Commonwealth’s contention that the issue of insanity cannot now be raised because petitioner took no appeal, we note only that if petitioner was, in fact, insane during the time an appeal could have been taken, his infirmity would operate to vitiate any present obstacle caused by his failure to appeal. Cf. Thomas v. Cunningham, 313 F. 2d 934, 937 (4th Cir. 1963) (excuse for non-exhaustion of state remedies). In this case, that infirmity has abundant support in the record.
Summarized in tabular form, the pertinent dates appear in this way:
April 4, 1952 — Murder committed.
*543September 5, 1952 — Plea of guilty entered.
October 8 & 9, 1952 — Hearing to determine degree of guilt.
November 5, 1952 — Degree of guilt and sentence fixed.
Opinion in support thereof filed.
November 18, 1952 — Petitioner transferred to Western Correctional Diagnostic and Classification Center.
December 23, 1952 — Center authorities petitioned for lunacy commission.
December 30, 1952 — Commission appointed by the court.
January 5, 1953 — Commission report signed.
January 8, 1953 — Commission report filed with court. Petitioner ordered committed to mental institution at Farview.
January 13, 1953 — Petitioner admitted to Farview.
January 22, 1953 — Farview report on petitioner’s mental status.
September 9, 1958 — Petitioner escaped from Farview.
[At this point, the records before us become incomplete, and the last two dates given below are given on the basis of petitioner’s allegations.]
May 6, 1959 — Petitioner apprehended and returned to Lawrence County jail.
June 10, 1959 — Petitioner adjudged mentally sound by a local sanity commission.
The Act of March 31, 1860, P. L. 427, §67, 19 P.S. §1352, provides for jury methods of determining mental competency at arraignment. As we view the statute, it has no application in determining, in a habeas corpus hearing, whether a past plea was entered without the requisite mental competency. That determination is to be made by the hearing judge.
In this hearing, because of the complexity of the proceeding, the serious consequences which will attend the conclusions reached *544there, and the obviously non-frivolous nature of the petition, petitioner will, of course, be represented by retained or assigned counsel.
Section 344 of P. L. 533 was amended subsequent to the pertinent dates of the trial proceedings. Act of May 31, 1956, P. L. 1897, §1; Act of June 13, 1957, P. H. 296, §1, 50 P.S. 1224 (Supp. 1964). The subsection amended is neither pertinent to any statutory provision relating to this case nor would such a provision be retroactive to the time of the original proceedings.
Of course, a new trial would proceed in accordance with present law, including any applicable sections of the Mental Health Act of 1951 and the Act of March 31, 1860.
Two months intervened between the time the guilty plea was entered and the sentence was imposed.
Our order assumes petitioner’s competency at the present time. His petition for writ of habeas corpus alleges his present mental soundness, the Commonwealth has not denied this allega*545tion, and petitioner is not now in a mental institution. Upon remand, should it appear that petitioner is not competent, all proceedings herein directed shall be stayed. See Act of June 12, 1951, P. L. 533, §347, as amended, 50 P.S. §1227 (Supp. 1964).