Opinion by
Mr. Justice Roberts,In December 1959, appellant was found near the body of his wife with a self-inflicted bullet wound in his left temple. Subsequently he was indicted for her murder and brought to trial.1 Originally he pleaded not guilty, but shortly after the jury was sworn he requested, through his court appointed counsel, permission to withdraw this plea and “enter a plea of guilty to second degree murder.” After ascertaining that the Commonwealth would not introduce evidence to prove that appellant was actually guilty of murder in the first degree, the court accepted the changed plea. When the Commonwealth had completed *340its case, the defense rested. The court then found the appellant guilty and sentenced him to a term of imprisonment of ten to twenty years. No post trial motions were filed nor was an appeal taken.
Approximately five years later appellant filed a petition for a writ of habeas corpus in the Court of Common Pleas of Washington County attacking the validity of his plea. This appeal is from the denial, without a hearing, of that petition. We are of the view that the court below was correct and accordingly affirm its order.
One of the grounds alleged by appellant in support of his petition is that the trial court had no authority to accept a plea to “second degree murder.” Because a defendant may not enter a guilty plea to murder in the first degree, the accepted practice in Pennsylvania if he desires to plead guilty, is for him to enter a guilty plea to murder generally. Commonwealth ex rel. Hobbs v. Russell, 420 Pa. 1, 2, 215 A. 2d 858, 859 (1966); Commonwealth v. Samuel Jones, 355 Pa. 522, 525, 50 A. 2d 317, 319 (1947); Commonwealth v. Iacobino, 319 Pa. 65, 67-68, 178 Atl. 823, 825 (1935). When properly made such a plea is sufficient of itself to sustain a conviction for murder in the second degree. Commonwealth ex rel. Davis v. Russell, 422 Pa. 223, 226, 220 A. 2d 858, 859 (1966); Commonwealth v. Iacobino, supra. The burden is then on the Commonwealth to prove that the offense meets the requirements of murder in the first degree. Commonwealth ex rel. Andrews v. Russell, 420 Pa. 4, 6, 215 A. 2d 857, 858 (1966); Commonwealth v. Chapman, 359 Pa. 164, 167, 58 A. 2d 433, 434 (1948). Similarly if the defendant desires to reduce the crime to that of voluntary manslaughter, the burden is upon him to adduce evidence which will so mitigate the offense. Commonwealth v. Kirkland, 413 Pa. 48, 63, 195 A. 2d 338, 345 (1963); Commonwealth v. Etzoola, *34152 Luzerne L.R. 270 (1962); see Commonwealth v. Jordan, 407 Pa. 575, 588, 181 A. 2d 310, 317 (1962); Commonwealth v. Carroll, 326 Pa. 135, 137, 191 Atl. 610, 611 (1937); Commonwealth v. Drum, 58 Pa. 9 (1868). Once a court accepts a plea of guilty to murder generally, it has the sole responsibility for fixing the degree of guilt and the penalty from the testimony produced and is not bound by any prior understanding between the Commonwealth and the defendant. Commonwealth ex rel. Hobbs v. Russell, supra; Commonwealth v. Kirkland, 413 Pa. 48, 195 A. 2d 338 (1963); Commonwealth ex rel. Dandy v. Banmiller, 397 Pa. 312, 315-16, 155 A. 2d 197, 199 (1959). Although contrary to proper procedure, we fail to see any prejudicial error in the court’s acceptance of defendant’s specific plea to murder in the second degree, provided the plea was knowingly entered. Compare Commonwealth ex rel. Ward v. Russell, 419 Pa. 240, 241 n.l, 213 A. 2d 628, 629 n.l (1965) ; Commonwealth ex rel. Green v. Rundle, 413 Pa. 401, 404, 196 A. 2d 861, 863 (1964); Commonwealth v. Petrillo, 340 Pa. 33, 16 A. 2d 50 (1940).
Recently in Commonwealth ex rel. West v. Myers, 423 Pa. 1, 222 A. 2d 918 (1966) we had occasion to consider the vulnerability of a guilty plea to collateral attack. When voluntarily and knowingly made such a plea is conclusive and binding upon the defendant. However, because a guilty plea operates as a waiver of all constitutional, statutory, and judicially created safeguards ordinarily surrounding the adversary system, a habeas court in considering the voluntary nature of the plea can not adhere to the generally prevailing rule that knowledge of counsel may be imputed to a defendant.2 Id. at 6, 222 A. 2d at 921; see Kerche*342val v. United States, 274 U.S. 220, 223-24, 47 S. Ct. 582, 583 (1927). Before dismissing a petition -which alleges the invalidity of a guilty plea, the habeas court must assure itself, by examining the record or by holding a hearing, that the decision to so plead was, at the time it was given, the defendant’s own voluntary and intelligent choice, not merely the choice of his counsel.3 Commonwealth ex rel. West v. Myers, supra.
In support of his conclusion that his guilty plea was not knowingly made appellant asserts that at the time of the trial he was suffering from the effects of his self-inflicted wound, which prevented him from adequately assisting in his defense and from fully understanding the consequences of his plea. Moreover, he alleges that the decision to plead guilty was made by his counsel, who, by failing to present testimony tending to show that appellant’s offense amounted to no more than voluntary manslaughter, did not provide competent representation. The Commonwealth denies these allegations and answers by asserting that appellant agreed not to attempt to reduce the crime to manslaughter in exchange for the Commonwealth’s willingness to forego seeking a conviction for murder in the first degree. It is the Commonwealth’s position that this strategy, which possibly saved the appellant from the electric chair, is binding upon him and cannot be attacked at this late date. See Commonwealth *343ex rel. Adderley v. Myers, 418 Pa. 366, 368, 211 A. 2d 481, 483 (1965); Commonwealth v. Kirkland, 413 Pa. 48, 54, 195 A. 2d 338, 341 (1966); cf. Commonwealth ex rel. LaRue v. Rundle, 417 Pa. 383, 207 A. 2d 829 (1965).
The task of the habeas court would frequently be less difficult if the record of the original proceedings contained a direct inquiry into the defendant’s understanding of his action. Commonwealth ex rel. West v. Myers, supra at 7, 222 A. 2d at 922; Commonwealth ex rel. Crosby v. Rundle, 415 Pa. 81, 85, 202 A. 2d 299, 302 (1964), cert. denied, 379 U.S. 976, 85 S. Ct. 677 (1965); Commonwealth ex rel. Barnosky v. Maroney, 414 Pa. 161, 165, 199 A. 2d 424, 426 (1964). Because no such inquiry was made in the instant case, the transcript of the trial proceedings itself does not disclose whether, at the time he entered his plea, appellant misapprehended the effect of the Commonwealth’s decision not to seek to prove the elements of murder in the first degree upon his own desire to show mitigating circumstances. Nonetheless, our cases have not set forth a fixed procedure for determining the validity of a guilty plea; rather we have held that this is a factual issue which must be resolved on a case by case basis according to the defendant’s actual understanding of his plea and his willingness to enter it. Commonwealth ex rel. West v. Myers, supra; Commonwealth ex rel. Hilberry v. Maroney, 417 Pa. 534, 207 A. 2d 794 (1965); Commonwealth ex rel. Crosby v. Rundle, supra; Commonwealth ex rel. Barnosky v. Rundle, supra. Thus, in the instant case, despite the incompleteness of the court’s inquiry, our review of the entire record, when considered in light of appellant’s petition, satisfies us that the denial of a hearing was justified.
A habeas court must hold a hearing whenever, accepting as true all allegations of fact which are *344nonfrivolous, specific, and not contradicted by the record, the petition states grounds for relief; however, these facts “must be alleged with compelling particularity and definiteness.” Commonwealth ex rel. Stevens v. Myers, 419 Pa. 1, 22 n.28, 213 A. 2d 613, 625 n.28 (1965) ; see Commonwealth ex rel. Hilberry v. Maroney, 417 Pa. 534, 540, 207 A. 2d 794, 797 (1965); Commonwealth ex rel. Wilson v. Rundle, 412 Pa. 109, 111, 194 A. 2d 143, 144 (1963). The failure to allege any facts from which one can draw an inference that appellant had even a tenable manslaughter defense renders Brubaker v. Dickson, 310 F. 2d 30 (9th Cir. 1962), cert. denied, 372 U.S. 978, 83 S. Ct. 1110 (1963), upon which appellant relies heavily, inapplicable. Nor can we conclude in the fact of the findings of a specially appointed commission that appellant understood the gravity of the offense and had the mental capacity to cooperate Avith his attorneys, that his counsel was incompetent in failing to challenge appellant’s competency to stand trial. See Commonwealth ex rel. LaRue v. Rundle, 417 Pa. 383, 386-89, 207 A. 2d 829, 831-33 (1965) ; Commonwealth ex rel. Crosby v. Rundle, 415 Pa. 81, 87, 202 A. 2d 299, 303 (1964), cert. denied, 379 U.S. 976, 85 S. Ct. 677 (1965) ; cf. Commonwealth ex rel Hilberry v. Maroney, 417 Pa. 534, 207 A. 2d 794 (1965). Finally, in his petition before this Court, as well as in the court below, appellant concedes “he probably did concent [sic] to making a deal with the state rather than risk going to the electric chair”, thus indicating he was fully aware of the nature of the understanding between his counsel and the Commonwealth’s representative.
Appellant’s last mentioned argument, however, goes further, for he urges us to hold that any bargain made under the threat of the electric chair is necessarily coercive and invalid. We turn to a consideration of that argument.
*345Although the subject of considerable criticism,4 plea bargaining between the prosecution and the defense is a frequently resorted to technique.5 In exchange for a guilty plea, the prosecutor may agree to recommend a lighter sentence, to accept a plea to a lesser included offense, or to dismiss other pending charges. See United States ex rel. McGrath v. LaVallee, 319 F. 2d 308 (2d Cir. 1963); Martin v. United States, 256 F. 2d 345 (5th Cir. 1958) ; United States ex rel. Elksnis v. Gilligan, 256 F. Supp. 244, 255 (S.D.N.Y. 1966); McClure v. Boles, 233 F. Supp. 928, 931 (N.D.W.Va. 1964); Anderson v. North Carolina, 221 F. Supp. 930 (W.D.N.C. 1963); Barber v. Gladden, 220 F. Supp. 308, 314 (D. Ore. 1963), aff’d, 327 F. 2d 101 (9th Cir. 1964); State v. Maberry, 93 Ariz. 306, 380 P. 2d 604 (1963); Hinckle v. State, 189 A. 2d 432 (Del. 1963); In re Valle, 364 Mich. 471, 110 N.W. 2d 673 (1961); People v. Griffin, 7 N.Y. 2d 511, 166 N.E. 2d 684, 199 N.Y.S. 2d 674 (1960); People v. Picciotti, 4 N.Y. 2d 340, 175 N.Y.S. 2d 32, 151 N.E. 2d 191 (1958); 8 Moore’s Federal Practice *346¶11.02 [1]; Newman, Pleading Guilty for Considerations : A Study of Bargain Justice, 46 J. Crim. L., C. & P.S. 780 (1956); Weintraub & Tougb, Lesser Pleas Considered, 32 J. Crim. L., C. & P.S. 506 (1941); Comment, The Influence of tbe Defendant’s Plea on Judicial Determination of Sentence, 66 Yale L.J. 204 (1956); Note, Guilty Plea Bargaining: Compromises by Prosecutors To Secure Guilty Pleas, 112 U. Pa. L. Rev. 865, 896-908 (1964). Criticism of this practice is generally rooted in philosophical concepts of criminal justice.6 It has been suggested, for example, that the prosecutor’s obligation is to enforce, not compromise, society’s determination that certain conduct be punished and that plea bargaining will undermine the deterrent effect of criminal punishment.7 Plea bargaining has also been announced as being unfair to defendants on the theory that a guilty plea induced by a promise of leniency is akin to a confession so obtained.8 Closely *347related to this objection is the fear that innocent men are apt to succumb to “bargains” offered by prosecutors more interested in a high conviction rate than truth.9
Realistically, however, plea bargaining, when surrounded by proper safeguards, is frequently in the best interest of both the Commonwealth and the accused. See United States v. Von Der Heide, 169 F. Supp. 560, 565 (D.D.C. 1959); Polstein, How To “Settle” A Criminal Case: The Art of Negotiating Lesser Pleas and Sentences, in The Problem of a Criminal Defense (ALI ed. 1961); Newman, Pleading Guilty for Considerations: A Study of Bargain Justice, 46 J. Crim. L., C. & P.S. 780, 789-90 (1956); Note, Guilty Plea Bargaining: Compromises by Prosecutors To Secure Guilty Pleas, 112 U. Pa. L. Rev. 865, 878-82 (1964). From the Commonwealth’s viewpoint the inability. to bargain would lead to a substantial increase in required manpower prosecutorial and in the number of necessary trials,10 even though a satisfactory resolution of the state’s interest can often be obtained with less than the potential maximum punishment available.11
*348From tbe accused’s viewpoint, tbe abolition of plea bargaining might be disastrous, for there would then be little incentive for the state to acquiesce in less than the maximum available punishment. One can readily understand why a defendant, who has no doubt about the ability of the Commonwealth to prove its case would be willing, in exchange for some concessions by the Commonwealth, to plead guilty, thus saving the state the expense of a protracted trial. Even when the evidence, although not overwhelming, is more than sufficient to sustain a conviction, it may well be in the defendant’s best interest to plead guilty rather than to gamble and lose, when losing may result in the deprivation of liberty for an extended period of time or the death sentence.12 See McCoy v. United States, 363 F. 2d 306, 308-09 (D.C. Cir. 1966).
In our opinion there is neither an overriding interest of society which would prohibit such prosecutorial discretion nor must such bargaining invariably *349infringe upon the defendant’s constitutional rights. “At its best,” one noted commentator suggests, “this system is superior to that of trials. A good defense lawyer can present helpful information concerning his client and his problems which may lead to the working out of a more rational disposition than would be possible through trial of the case.” 13 Of course one appreciates the agonizing choice offered some defendants, although for others, who desire to avoid the uncertainties of trial, the choice may be obvious. In any event we prefer this to the alternative of no choice.
While we are not willing to completely proscribe plea bargaining, we do recognize that the awesome effect of a guilty plea14 and the sensitive nature of the bargaining process makes certain safeguards essential.15 “Our concept of due process must draw a distinct line between, on the one hand, advice from and ‘bargaining’ between defense and prosecuting attorneys and, on the other hand, discussions by judges who are ultimately to determine the length of sentence to be imposed.” United States ex rel. McGrath v. LaVallee, 319 F. 2d 308, 319 (2d Cir. 1963) (Marshall, J., dissenting) ;16 *350see Commonwealth v. Senauskas, 326 Pa. 69, 191 Atl. 167 (1937). Also the defendant may not enter a plea without prior consultation with his counsel17 and he must fully comprehend the significance of the prosecutor’s inability to bind the court. Finally, before accepting a guilty plea, the trial court has the responsibility of satisfying itself that the defendant understands the meaning of the charge, the consequences of pleading guilty, and that the acceptance of the plea will not result in a miscarriage of justice.18 Commonwealth ex rel. West v. Myers, 423 Pa. 1, 222 A. 2d 918 (1966); see Machibroda v. United States, 368 U.S. 487, 82 S. Ct. 510 (1962); Kercheval v. United States, 274 U.S. 220, 47 S. Ct. 582 (1927) ; cf. Commonwealth v. Cavanaugh, 183 Pa. Superior Ct. 417, 423-25,133 A. 2d 288, 291-92 (1957).
We are satisfied that under the facts of this case there is no valid reason for concluding that appellant’s plea of guilty was not knowingly and understandingly entered. Since the allegations of petitioner, even if true, would not require relief, there was no need for a hearing. Accordingly, the order of the court below denying the writ of habeas corpus is affirmed.
Mr. Justice Cohen took no part in the consideration or decision of this case.Appellant was not brought to trial until September 1960 because the court, at the request of the district attorney, appointed a commission to inquire into his mental condition. This commission recommended further study and possible treatment. In July 1960 a second commission reported that appellant understood the gravity of the offense charged and had the mental capacity to cooperate with his attorneys in the preparation of his defense.
A plea of guilty is equivalent to a conviction and constitutes a waiver of all nonjurisdictional defects and defenses. Commonwealth ex rel. Ward v. Russell, 419 Pa. 240, 213 A. 2d 628 (1965); Commonwealth ex rel. Crosby v. Rundle, 415 Pa. 81, 202 A. 2d 299 *342(1964), cert. denied, 379 U.S. 976, 85 S. Ct. 677 (1965). Any prior irregularity in the proceedings against the defendant is relevant only as it affects the voluntary nature of the plea itself. Hudgins v. United States, 340 F. 2d 391 (3d Cir. 1965) ; United States v. Morin, 265 F. 2d 241 (3d Cir. 1959) ; United States ex rel. Perpiglia v. Rundle, 221 F. Supp.,1003 (E.D. Pa. 1963).
Under Pa. Crim. R. 319(a) a court may not accept a guilty plea “unless it determines that it is competently and intelligently made.” This rule is patterned after the predecessor to Fed. R. Crim. Pro. 11. Compare the current Rule 11, effective as of July 1, 1966.
See, e.g., Moley, Politics and Criminal Prosecution 156-65, 187-90 (1929); Dash, Cracks in the Foundation of Criminal Justice, 46 Ill. L. Rev. 385, 392-405 (1951) ; Ohlin & Remington, Sentencing Structure: Its Effect Upon Systems for the Administration of Criminal Justice, 23 Law & Contem. Prob. 495 (1958) ; Note, Prosecutor’s Discretion, 103 U. Pa. L. Rev. 1057, 1070-71 (1955) ; Comment, The Influence of the Defendant’s Plea on Judicial Determination of Sentence, 66 Yale L.J. 204 (1956).
In Pennsylvania during 1965, 14,856 defendants, or close to 63% of all defendants convicted, entered guilty pleas. Letter dated November 3, 1966 from John Yeager, Director, Research and Statistics, Bureau of Corrections, Department of Justice, Harrisburg, Pennsylvania.
Pa. Crim. R. 319(b) inferentially recognizes the prevalence of plea bargaining: “The court, with the consent of the attorney for the Commonwealth, may accept a plea of guilty to any included offense or to any count in an indictment and may discharge the defendant on the other offenses or counts charged.”
See Arnold, Law Enforcement — An Attempt at Social Dissection, 42 Yale L.J. 1, 18 (1932).
See Dash, supra note 4 at 395-97; Newman, Pleading Guilty for Considerations: A Study of Bargain Justice, 46 J. Crim. L., C. & P.S. 780, 790 (1956) ; Ohlin & Remington, supra note 4 at 507.
See United States v. Cariota, 323 F. 2d 180, 189 (3d Cir. 1963) (separate opinion of Biggs, C. J.) ; Shelton v. United States, 242 F. 2d 101, 111-13, rev’d on rehearing, 246 F. 2d 571 (5th Cir. 1957) (en banc), rev’d on confession of error, 356 U.S. 26, 78 S. Ct. 563 (1958). But see Note, Guilty Plea Bargaining: Compromises by Prosecutors To Secure Guilty Pleas, 112 U. Pa. L. Rev. 865, 884 (1964) : “A guilty plea and a confession are analogous but distinct concepts. A confession is an averment that certain facts occurred, and is used as evidence in a fact-finding proceeding — trial—whose whole purpose is to determine whether the facts actually occurred. The nature of the trial proceeding requires that consideration be given to evidence, such as a confession, only to the extent that it has probative value, and, therefore, strict rules of admissibility have been formulated. On the other hand, the guilty plea is not necessarily an admission that the defendant engaged in a criminal incident, but is a conclusion that there is sufficient evidence for a judge or jury to find that he did so. As a result of this distinction, the guilty plea gives rise to a procedure for disposition of *347the case that is different from trial. The court is no longer concerned with whether given facts occurred, but only with whether the defendant has made an informed determination that a judge or jury could find such facts on the prosecution’s evidence. . . .”
See Dash, supra note 4 at 393-94, 401.
See 8 Moore’s, Federal Practice ¶11.02[1] (2d ed. 1966) ; Newman, supra note 7 at 788; Note, Guilty Plea Bargaining: Compromises by Prosecutors To Secure Guilty Plea Bargaining, 112 U. Pa. L. Rev. 865, 899 (1964) (Question 5).
One of the most common rationalizations by prosecutors for permitting pleas to lesser offenses is the severity of the sentence if the defendant is found guilty of the offense for which he was indicted. See Ohlin & Remington, supra note 4 at 505; Weintraub & Tough, Lesser Pleas Considered, 32 J. Crim. L., C. & P.S. 506, 510 (1941); see generally id. This attitude is in accord with the view which regards rehabilitation of the individual defendant as *348one of the primary goals of criminal punishment. See Bennett, The Sentence and Treatment of Offenders, 339 Annals 142 (Jan. 1962). Moreover, the certainty of detection and punishment is generally considered a more effective deterrent than the severity of the punishment. Andenaes, The General Preventive Effects of Punishment, 114 U. Pa. L. Rev. 949, 964 (1966) ; see generally id. at 960-70.
“One of the most important, if not the most important functions of defense counsel is working out with the prosecuting attorney the most favorable disposition of his client’s case, without any real prospect of acquittal.” Schwartz, Gases and Materials on Professional Responsibility and the Administration of Criminal Justice 182 (1962). See also, Polstein, How To “Settle” A Criminal Case: The Art of Negotiating Lesser Pleas and Sentences, in The Problem of a Criminal Defense (ALI ed. 1961). It may also be worth noting that Judge J. Shelly Wright of the United States Court of Appeals for the District of Columbia believes that recent decisions of the Supreme Court of the United States regarding the right to counsel will work to the advantage of those defendants desiring to plead guilty. Wright, The New Role of Defense Counsel Under Escobedo and Miranda, 52 A.B.A.J. 1117, 1119-20 (1966).
Barrett, Criminal Justice: The Problem of Mass Production, in The Courts, The Public, and The Law Explosion 85, 109 (Jones ed. 1965). One needs to remember also that jury trials, with all their attendant safeguards, are not infallible. See Borchard, Convicting the Innocent (1932) ; Frank, Not Guilty (1957).
See note 2 supra.
“A guilty plea, if induced by promises or threats which deprive it of the character of a voluntary act, is void.” Machibroda v. United States, 368 U.S. 487, 493, 82 S. Ct. 510, 513 (1962) (Emphasis supplied.)
Accord, United States ex rel. Elksnis v. Gilligan, 256 F. Supp. 244 (S.D. N.Y. 1966) ; United States v. Tateo, 214 F. Supp. 560 (S.D. N.Y. 1963) ; see United States ex rel. McGrath v. LaVallee, 319 F. 2d 308 (2d Cir. 1963) ; State v. Boulton, 229 Minn. 576, 40 N.W. 2d 417 (1949) ; Rogers v. State, 243 Miss. 219, 136 So. 2d 331 (1962) ; Comment, The Influence of the Defendant’s Plea on the Judicial Determination of Sentence, 66 Yale L.J. 204 (1956).
Commonwealth ex rel. Johnson v. Maroney, 416 Pa. 451, 206 A. 2d 322 (1965) ; Commonwealth ex rel. O’Lock v. Rundle, 415 Pa. 515, 204 A. 2d 439 (1964) ; cf. Dash, supra note 4 at 402.
“When the appellate or habeas corpus court is convinced that the accused, fully represented by counsel, has been fairly treated, plea bargaining has its best chance to be held voluntary. Without a record demonstration of fundamental fairness, any plea of guilty based on plea bargaining is in jeopardy on appeal or collateral attack.” Wright, supra note 12 at 1120.