Appeal by defendant, as limited by his brief, from a resentence of the Supreme Court, Queens County, imposed March 29, 1974, upon his conviction of attempted robbery in the first degree, on his plea of guilty, the sentence being an indeterminate prison term of from three and one-half to seven years. Resentence modified, as a matter of discretion in the interest of justice, by reducing the sentence to an indeterminate term of from three to six years. As so modified, resentence affirmed. The second felony offender sentencing provisions of section 70.06 of the Penal Law are mandatory. The purpose of the procedures of CPL 400.21 is to ensure that defendants sentenced under section 70.06 of the Penal Law are, in fact, second felony offenders. That procedure was not intended to allow known second felony offenders to be sentenced as first offenders if the prosecutor failed to comply with its provisions. In this case, appellant twice admitted, prior to his initial sentencing, that he was a second felony offender. Under these circumstances, CPL 400.21 required the court to defer sentencing until the appropriate information had been filed by the prosecutor. The fact that he did not do so rendered the initial sentence invalid as a matter of law, and subject to vacatur upon motion of the People under CPL 440.40. Prior to the resentencing of appellant as a second felony offender, a second felony offender information was filed, and full compliance was had with the provisions of CPL 400.21. Appellant admitted the truthfulness of the predicate felony allegation, and did not wish to controvert the validity of the conviction. Therefore, the second felony offender sentence was properly imposed. However, in accordance with the sentencing court’s intention to sentence defendant to the minimum term permissible, we have modified the sentence to an indeterminate term of from three to six years. Latham, Acting P. J., Margett, Rabin, Titone and Hawkins, JJ., concur.