OPINION OF THE COURT
On February 6,1985, the defendant, following the denial of a motion to suppress identification testimony, entered a plea of guilty to robbery in the first degree in satisfaction of all counts of the indictment herein. With the consent of the Assistant District Attorney, the defendant was promised that if he were found not to be a predicate felon, he would receive a sentence of two to six years in State prison. Alternatively, he was promised that were he determined to be a second felony offender he would be permitted to withdraw his plea of guilty to robbery in the first degree and substitute therefor a plea to robbery in the second degree, on which he would be sentenced to a term of from three to six years’ incarceration.
Thereafter, a predicate felony offender hearing was conducted, pursuant to the terms of CPL 400.21. The District Attorney had filed a predicate felony statement, alleging that on June 7, 1973 the defendant had been convicted, on indictment No. 7486/71, of robbery in the third degree, and that on the same *938date the defendant had been convicted, on indictment No. 9003/72, of the same felony offense. The District Attorney further alleged, under Penal Law § 70.06 (1) (b) (v), that the 10-year period within which the predicate felonies must have been committed was extended by a term of one year, three months and 13 days, said term representing the period of the defendant’s confinement within the New York City Department of Correction between the commission of those predicate felonies and the execution of sentence thereon.
The defendant, in challenging his alleged status as a predicate felon, sought to controvert the claim that he was, in fact, the person so convicted under 9003/72, as well as the claim that the convictions fell within the statutorily mandated period. In this latter regard, he contended that he was in fact sentenced on his only prior felony (7486/71) in the fall of 1972, such conviction therefore being too remote in time from the instant crime to constitute a predicate felony.
At the conclusion of the testimony upon the hearing, the defendant further argued that the tolling provisions of section 70.06 (1) (b) (v) were unconstitutional as violative of equal protection.
The People have established, to the satisfaction of the court beyond a reasonable doubt, the identity of the defendant Samuel Kennedy as the individual who was convicted of robbery in the third degree (a class D felony), by plea of guilty, both on indictments 7486/71 and 9003/72. They have further established, beyond a reasonable doubt, the date of such convictions as being June 7, 1973 (People v Bryant, 47 AD2d 51 [2d Dept 1975]).
The date of commission of the crime for which the defendant is now to be sentenced was July 2,1984,11 years, three weeks and four days after the defendant was convicted and sentenced on the prior offenses.
In support of their contention that the defendant is a predicate felon the People have further established, beyond a reasonable doubt, that the defendant was incarcerated from March 29,1972 to July 11,1973 (a period of one year, three months and 13 days). Having shown that this period of incarceration occurred between the commission of the instant crime and the commission of the crimes alleged herein as predicates, the People contend that the 10-year period contemplated by section 70.06 must be extended by a term of one year, three months and 13 days, and that the prior convictions have thus been established as predicate felonies warranting the enhanced punishment authorized *939by that statute for a second felony offender. Although between 1973 and the date of the commission of the instant crime the defendant appears to have been convicted and incarcerated on various misdemeanors, the People have not elected to allege the tolling of the statute by virtue of such convictions. Given the allegations of the predicate felony statement filed by the People (GPL 400.21), the court addresses herein only the validity of the tolling provisions of section 70.06 (1) (b) (v) as applied to the defendant’s incarceration from March 29,1972 through July 11, 1973.
With the following possible exclusions, the court has determined that the defendant’s incarceration between March 29, 1972 and July 11,1973 was due solely to his inability to post bail to secure pretrial release. There was a period, from September 28, 1972 to January 17, 1973, when the defendant was remanded for sentence on a subsequently vacated plea of guilty under indictment No. 890/71. This constitutes three months and 20 days. There was a further period, from June 7, 1973 to July 11, 1973, when the defendant was incarcerated, following imposition of sentence, pending his transfer to the Narcotics Addiction Control Commission (NACC). This constitutes one month and four days.
Excluding these two periods, together totaling four months, 24 days, the court finds that the defendant’s 1972-1973 incarceration was due solely to his financial condition.
To add such time to the 10-year period during which the defendant was to remain crime free is to deny to the defendant his constitutionally guaranteed right to equal protection. It is the finding of the court that, solely as a result of the defendant’s financial status in 1972, he now stands before the court as an alleged second felony offender.
The court finds the second felony offender statute unconstitutional as applied on the unusual facts of this case.
There is a strong presumption as to the constitutionality of any legislative enactment (People v Broadie, 45 AD2d 649, affd 37 NY2d 100, cert denied 423 US 950 [1975]), but this will not preclude a court from inquiring into the validity of such presumption (People v Pagnotta, 25 NY2d 333 [1969]; People v Kaiser, 21 NY2d 86, affd 394 US 280 [1969]; People v Gonzalez, 402 NYS2d 584 [1978]).
Although a statute may be nondiscriminatory on its face, it may be grossly discriminatory in its operation (Griffin v Illinois, 351 US 12, 17, n 11 [1956]; Williams v Illinois, 399 US 235 [1970]). The issue is whether the State has invidiously denied *940one class of defendants a substantial benefit available to another class of defendants under the equal protection clause (Bearden v Georgia, 461 US 660 [1983]). Factors to be considered by a court in resolving this issue are the type of individual interest affected, the extent to which it is affected, whether there is a rational connection between the legislative means and purpose, and whether alternative means exist for effectuating the purpose (Bearden v Georgia, supra; Williams v Illinois, supra, at p 260, Harlan, J., concurring).
The State’s legitimate interest in deterring violation of its penal statutes is furthered by treating second felony offenders more harshly than first-time felons (People v Owens, 58 AD2d 587 [2d Dept 1977]; People v Brown, 54 AD2d 585 [2d Dept 1976]; People v Sibley, 54 AD2d 772 [3d Dept 1976]; People v Abbott, 113 Misc 2d 766 [1982]) and by requiring a defendant to demonstrate his ability to function in society in a lawful manner for 10 years following a felony conviction (People v Woodman, 94 Misc 2d 266, affd 73 AD2d 847 [1st Dept 1979]).
In the instant case, the defendant has demonstrated his ability to stay “crime-free” for 10 years from the date of his initial felony conviction (June 7, 1973). However, the operation of section 70.06 required that he demonstrate his ability to refrain from crime for an additional one year, three months and 13 days (the term of his preconviction incarceration in lieu of bail).
In Williams v Illinois (supra, at p 244), the United States Supreme Court held that an indigent criminal defendant cannot be imprisoned beyond the maximum period authorized by statute due solely to his inability to make payment of an imposed fine, stating that: “[T]he Equal Protection Clause of the Fourteenth Amendment requires that the statutory ceiling placed on imprisonment for any substantive offense be the same for all defendants irrespective of their economic status.”
In Tate v Short (401 US 395 [1971]), the court extended the Williams principle and held that a State cannot convert a fine imposed under a statute which prescribes only fines into a term of imprisonment solely because the defendant is indigent and cannot pay the fine. The rule was further extended in Bearden v Georgia (supra), where the court held that the State cannot constitutionally revoke a sentence of probation and imprison a defendant for failure to make payment of a fine and restitution unless it has determined that the defendant was responsible for failing to make such payment or that alternative forms of punishment are inadequate. These rules “restrict the State’s power to increase the stringency of sentences already imposed *941on convicted indigent defendants” (People v Memminger, 121 Misc 2d 953, 956 [1983]).
In United States v Gaines (436 F2d 1069, vacated and remanded 402 US 1006, on remand 449 F2d 143, 144 [2d Cir 1971]), the court interpreted the Supreme Court’s decisions in Tate v Short (supra) and Williams v Illinois (supra) as upholding the proposition that “a man should not be kept imprisoned solely because of his lack of wealth” (McGinnis v United States ex rel. Pollack, 452 F2d 833 [2d Cir 1971], cert denied 406 US 905 [1972]).
In Gaines (supra), the defendant was prevented from commencing service of a Federal sentence of incarceration by his detention for failure to post bail on a pending State charge. The State charge subsequently being dismissed, Gaines sought credit against his Federal sentence for the time he spent in pretrial detention, arguing that an individual of greater means could have posted the State bond and commenced service of that sentence. The court found that “Gaines’ lack of wealth has resulted in his having to serve a sentence that a richer man would not have had to serve, an impermissible discrimination according to Tate and Williams” (p 144), and accordingly directed that he be credited with the time spent in State custody.
Had the defendant herein been able to post bond following his 1972 arrest, he would not now be subject to enhanced punishment pursuant to Penal Law § 70.06, since the instant conviction is beyond the 10-year period set forth therein.
The equal protection clause is violated when a defendant serves more time on sentences imposed merely because he is unable to make bail due to insufficient funds (McGinnis v United States ex rel. Pollack, supra).
While the legislative history of the predicate felony offender statutes is silent as to the purpose underlying the boundaries of the tolling provisions contained therein, the court can see validity in such boundaries in the case of a defendant, confined pretrial, who ultimately .receives a sentence of incarceration. For such a defendant receives credit, in the calculation of his date of release, for the period of preconviction detention (Penal Law § 70.30 [3]). In such a circumstance, the defendant incarcerated preconviction would be subject to a tolling of time identical to a defendant who had secured pretrial release.
In the case of a defendant, jailed preconviction, who ultimately receives a nonincarceratory sentence, however, the court is unable to divine any legitimate State interest in the tolling of time spent in pretrial confinement.
*942The constitutionality of the bail system in New York has been upheld as nondiscriminatory against the poor (Bellamy v Judges & Justices, 41 AD2d 196 [1st Dept], affd 32 NY2d 886, mod 33 NY2d 632 [1973]).
The only purpose for setting bail is to secure the defendant’s attendance in court (People ex rel. Lobell v McDonnell, 296 NY 109 [1947]; People v Gonzalez, supra; Bellacosa, Practice Commentary, McKinney’s Cons Laws of NY, Book 11 A, CPL 510.30, p 22).
Due process forbids the punishment of pretrial detainees since they are presumed innocent and because punishment can only be imposed after conviction (Bell v Wolfish, 441 US 520 [1979]; Rhem v Malcolm, 507 F2d 333, on remand 389 F Supp 964, amended 396 F Supp 1195, affd 527 F2d 1041 [2d Cir 1975]; Cooper v Morin, 91 Misc 2d 302, mod sub nom. Cooper v Lombard, 64 AD2d 130 [4th Dept], mod sub nom. Cooper v Morin, 49 NY2d 69, cert denied sub nom. Lombard v Cooper, 446 US 984 [1980]).
The court finds that the inclusion of the period of the defendant’s 1972-1973 preconviction detention from March 29, 1972 through July 11, 1973 in the tolling provisions of the predicate felony offender statute serves to punish the defendant in consequence of his indigency.
In Matter of La Viscount v Coughlin (103 Misc 2d 383 [1980]), the defendant moved to have the time he spent in jail credited against the minimum term of his sentence. He had been held in jail prior to trial and sentence because he was indigent and financially unable to make bail. The court held that the failure to credit the defendant with the entire period of his presentence custody, occasioned by reason of his financial inability to make bail conflicts with the defendant’s constitutional right to equal protection and, therefore, held the application of Penal Law § 70.30 (3), which increased the defendant’s term of imprisonment solely because of his failure to make bail, constitutionally impermissible.
Similarly, the application of section 70.06 (1) (b) (v) to Mr. Kennedy, which increases the punishment he will have to face solely because he was financially unable to post bond after his prior arrest and was, therefore, incarcerated, violates his constitutional right to equal protection of the laws. By extending the time in which Mr. Kennedy would have had to remain free from crime beyond the 10-year period intended by statute and as interpreted by existing case law, Mr. Kennedy would have been *943subjected to “serving a sentence that a richer man would not have had to serve.”
Therefore, the court finds Penal Law § 70.06 (1) (b) (v) unconstitutional as applied to this defendant, and will sentence him as a first-time offender.