When a reasonable view of the evidence would support the conclusion that the defendant committed the lesser offense, but not the greater, the court must submit the lesser included offense to the jury upon the request of a party (CPL 300.50). The judgment convicting defendant of burglary in the second degree should be reversed and the matter remanded for a new trial, because, in view of the testimony, it was error to decline defendant’s request that the jury be charged as to the lesser included offense of criminal trespass in the second degree.
There is a two-prong analysis for determining a defendant’s entitlement to a lesser included offense charge (see People v Van Norstrand, 85 NY2d 131, 136 [1995]). First, it must be impossible to commit the greater offense without concomitantly committing the lesser; then, there must be a reasonable view of the evidence to support the conclusion that defendant committed the lesser offense, but not the greater (id.). It is undisputed that criminal trespass in the second degree under Penal Law § 140.15 is a lesser included offense of burglary in the second degree under Penal Law § 140.25 (2), since it is impossible to commit burglary in the second degree under Penal Law § 140.25 (2) without necessarily committing criminal trespass in the second degree (see People v Rickett, 94 NY2d 929 [2000]; People v Greene, 291 AD2d 410 [2002], lv denied 98 NY2d 651 [2002]). Both crimes require knowingly entering or remaining unlawfully in a dwelling; the additional element required for burglary in the second degree under Penal Law § 140.25 (2) is that at the time he entered the building, the defendant harbored the intent to commit a crime therein (see People v Gaines, 74 NY2d 358, 363 [1989]). The only issue here is whether there is a reasonable view of the evidence that would support a finding that the defendant knowingly illegally entered or remained in the dwelling but did not harbor the intent to commit a crime therein at the time he entered the building.
While a jury is free to accept or reject part or all of the defense and prosecution’s evidence, there must be “some identifiable, rational basis on which the jury could reject a portion of the prosecution’s case which is indispensable to establishment of the higher crime and yet accept so much of the proof as would establish the lesser crime” (People v Scarborough, 49 NY2d 364, 369-370 [1980]). The basis of rejecting part of the prosecution’s case may not rely upon dissecting “the integrated testimony of a single witness as to whom credibility, or incredibility, could only be a constant factor” (id. at 373).
*117The People’s witnesses provided evidence that defendant had broken into the premises and was found in the process of attempting to steal property. The church’s superintendent testified that at the time of defendant’s arrest inside the premises, cupboards were found opened and in a “mess,” a cabinet was damaged, the office door lock was broken, the upstairs chapel door was broken, locks twisted off, and a chapel window was broken, with a piece of brick found nearby. Further, the arresting officers stated that they found defendant behind a kitchen door, with a black canvas bag at his feet in which were found a bolt cutter, tweezers, pliers, knives and a steel bar. Certainly, the condition in which the premises were found, and defendant’s apparent possession of the tools, provide an appropriate basis from which to infer defendant’s intent to steal, as the People posit.
For his part, defendant testified that he had entered the church through an open gate and door, looking for a place to sleep, went in, used the bathroom, then sat down and dozed off; he had awoken and was about to leave when the police arrived. He denied breaking a window or anything else, or having any tools with him.
In denying defendant’s request that it submit to the jury the lesser included charge of criminal trespass in the second degree, the trial court explained that “if you believe the defendant’s version, he’s not guilty of anything because he felt he had proper authority to go in there. And if you believe the People’s version, he’s not guilty of criminal trespass, he’s guilty of burglary.” The problem with this reasoning was that the jury could have believed the People’s witnesses and, without rejecting any of the testimony of the People’s witnesses, still have inferred, from the testimony, that at the time defendant illegally entered the premises he lacked the intent to commit a crime once inside.
The basis for this possible inference is certain testimony given by the church’s general contractor, in which he stated that he kept some tools in the church basement, and acknowledged that the bolt cutter found in the bag at defendant’s feet at the time of his arrest was his. He added that the other items found with defendant were the kinds of things he stored in the church basement, and while he was not sure those other items were also his, they “probably” could be.
This testimony was sufficient to undermine the inference that at the time he broke in, defendant intended to commit a crime once inside. If defendant only happened upon the burglar’s tools once inside the premises, it could be inferred that at the time he broke in, he did not have with him any tools *118to break locks, etc., and was simply intending to shelter indoors for a while on this cold February 11, 2002 night; in that case, defendant would have only formed the intent to use the burglar’s tools to commit larceny when he came upon the tools after he had illegally entered onto the premises.
In a case similar to this one, People v Henderson (41 NY2d 233 [1976]), the prosecution’s testimony indicated that the defendant had broken the glass of a rear window at an automobile dealership office, then fled on foot upon being discovered. The defendant admitted being on the dealership’s lot, but denied breaking the glass. He was charged with, and convicted of, attempted burglary in the third degree. In holding that the trial court erred in refusing the defendant’s request to charge criminal trespass in the third degree, the Court of Appeals reasoned that the jury, while entitled from the circumstantial evidence to infer an intent to commit a larceny once he gained entry to the premises, was similarly entitled to find a lack of such intent (id. at 237). Of particular applicability here, is the Court’s remark that “the jury could have decided that he never intended to commit a larceny, but rather was motivated by any one of a conceivable number of other purposes such as, for example, an intent to bed down in the premises . . .” (id.).
That reasoning applies in this case equally well. The jury was entitled from the circumstantial evidence to infer a lack of intent to commit a larceny once defendant gained entry to the premises. This being so, the matter must be remanded for a new trial (see People v Van Norstrand, 85 NY2d 131 [1995], supra; People v Gonzalez, 221 AD2d 203 [1995]).
Nor can the failure to submit a proper lesser included offense be considered harmless error. The People argue that since defense counsel, in summation, argued to the jury that it should find a lack of intent to commit a crime at the time defendant entered the premises, and the jury rejected it by convicting defendant of the burglary, the failure to give the lesser included charge was harmless. However, this rationale must be rejected; accepting it would effectively eviscerate all appellate case law with respect to lesser included offenses, since such rulings are only made after a jury has convicted the defendant of the greater offense.