*1084Appeal from a judgment of the Supreme Court, Erie County (Joseph S. Forma, J.), rendered June 11, 2002. The judgment convicted defendant, upon his plea of guilty, of attempted rape in the first degree and burglary in the second degree.
It is hereby ordered that the judgment so appealed from be and the same hereby is unanimously modified on the law by vacating that part of the plea of guilty to burglary in the second degree and as modified the judgment is affirmed and the matter is remitted to Supreme Court, Erie County, for further proceedings in accordance with the following memorandum: Defendant appeals from a judgment convicting him upon his plea of guilty of attempted rape in the first degree (Penal Law §§ 110.00, 130.35 [1]) and burglary in the second degree (§ 140.25 [2]). We agree with defendant that Supreme Court erred in accepting the plea because defendant’s statements during the factual colloquy negated the necessary element of unlawful entry with respect to the burglary charge (see People v Lopez, 71 NY2d 662, 666 [1988]; People v Serrano, 15 NY2d 304, 309-310 [1965]). The court attempted further inquiry to ensure that defendant’s plea was knowing and voluntary (see id.) but did not succeed in clarifying that defendant unlawfully entered the victim’s apartment (Penal Law § 140.25), and thus “the court’s subsequent questions [did not] remove[ ] the doubt about defendant’s guilt” (People v Ocasio, 265 AD2d 675, 678 [1999]). The court’s further inquiry did not rectify defendant’s negation of a necessary element of burglary, and thus defendant’s contention falls within the “rare case” exception to the preservation rule (Lopez, 71 NY2d at 666). We therefore modify the judgment by vacating that part of defendant’s plea of guilty to burglary in the second degree, and we remit the matter to Supreme Court for further proceedings on that count of the indictment. We note, however, that defendant pleaded guilty pursuant to a plea agreement that disposed of a three-count indictment and included a guilty plea to the lesser-included offense of attempted rape in the first degree. We therefore further specify that, upon remittal, “the court should entertain a motion by the People, should the People be so disposed, to vacate the plea ... in its entirety” (People v Irwin, 166 AD2d 924, 925 [1990]). Present—Pigott, Jr., P.J., Pine, Hurlbutt, Kehoe and Lawton, JJ.