Section 335-b of the Code of Criminal Procedure, as it read in 1960, required the court to inform the defendant, “ upon [his] arraignment * * * and before accepting a plea”,1 that, “by reason of the fact that [he] has previously *86been convicted of a crime ”, he will be subject to additional or heavier punishment than prescribed for the crime with which he was charged. On these appeals, we are called upon to decide whether a defendant who was not given the requisite warning may employ habeas corpus to redress such violation.
In both of the cases before us, the relators, following their pleas of guilty in 1960, were sentenced as prior felony offenders— Golan in the County Court of Queens County as a third such offender, Bristol in the Madison County Court as a second offender. In neither case had the judge presiding given the warning called for by section 335-b and each relator, some time after he started serving his sentence, sued out a writ of habeas corpus. The Clinton County Court dismissed Golan’s writ, while the Cayuga County Court sustained Bristol’s. On appeal, the Appellate Division—the Third Department in Golan’s case, the Fourth Department in Bristol’s — holding that habeas corpus was available, sustained the writs and remanded each relator to the court in which the indictment had been returned for rearraignment and repleading.
Section 335-b was enacted as a procedural safeguard, as an assurance that one who pleads guilty to a crime for which (let us say) a maximum of five years is prescribed will be made aware of the fact that he may be sent to prison for as long as ten years because of a prior conviction. The Legislature, in enacting the section, undoubtedly concluded that considerations of fundamental fairness demanded that a defendant, before entering a plea of guilty, be warned that the crime charged against him was one for which additional punishment is prescribed if he had been previously convicted of another offense. The purpose of the statute is to afford an accused the opportunity of deciding whether to plead guilty, knowing he runs the risk of a more severe sentence, or to deny guilt and stand trial. As a matter of fact, this court almost 40 years ago cautioned that district attorneys ‘‘ must be careful not to take a plea from a prisoner of a lesser degree of crime under circumstances which may lead him to believe that he is not to be dealt with as a [multiple] offender.” (People v. Gowashy, 244 N. Y. 451,465.)
We have already held that the court’s failure to give a defendant charged with a violation of the traffic laws the warning *87required by section 335-a of the code renders the conviction, entered upon a plea of guilty, void and subject to collateral attack. (See Matter of Hubbell v. Macduff, 2 N Y 2d 563.) This being so, it follows that noncompliance with the requirements of section 335-b, patterned after section 335-a and designed to operate in a far more serious area, must likewise render the conviction void and amenable to collateral attack by way of habeas corpus.
That decided, the question arises as to the scope of the relief to be granted. Should the relator simply be resentenced as a first offender or should he be remanded for rearraignment so that he may then decide either to plead guilty again or to plead not guilty and stand trial? Admittedly, the alternative first suggested has a certain appeal: the defendant, it may be urged, would receive the sentence he may have expected when he pleaded guilty and the People would not be forced, perhaps years after the crime and at a time when witnesses are no longer available, to try the case. However, since that alternative would violate the scheme and pattern of our multiple offender laws, we may not adopt it.
A reading of sections 1941 through 1943 of the Penal Law, as well as the cases decided under those provisions, leaves no doubt that second, third or fourth offenders “must receive” the heavier punishment which the legislation mandates. (See People v. Gowasky, 244 N. Y. 451, 462, supra.) It was, in other words, the legislative design that felony recidivists be punished more severely than first offenders. The matter may not be left to the discretion of prosecutor or judge for, as this court made clear in the Gowasky case (244 N. Y. 451, 465-466, supra), the statute commands the increased punishment and that mandate may not be avoided or waived.
In short, then, although the court’s failure to comply with section 335-b will protect a defendant from the imposition of such heavier punishment, it cannot effect a change in his status and render him a first offender. The demands of fairness dictated by section 335-b and the legislative scheme of imposing a more severe sentence upon recidivists are, however, both satisfied if the case is restored to the position it occupied just preceding the point — the taking of the plea—at which the section 335-b warning should have been given. This is accom*88plished by remanding the defendant to the trial court for rearraignment and repleading.
The order appealed from in each case should be affirmed.
In People ex rel. Bristol v. Murphy: Order affirmed.
Chief Judge Desmond and Judges Dye, Van Voorhis, Burke, Scileppi and Bergan concur.
In People ex rel. Colan v. La Vallee: Order affirmed.
Chief Judge Desmond and Judges Dye, Van Voorhis, Burke and Scileppi concur; Judge Bergan taking no part.
. The section was amended in 1963 to make explicit that the court was required to give the monition only “ before accepting a plea of guilty” (L. 1963, ch. 578).