Viewing the evidence adduced at trial in the light most favorable to the People (see, People v Contes, 60 NY2d 620), we find that it was legally sufficient to establish the defendant’s guilt beyond a reasonable doubt. Moreover, upon the exercise of our factual review power, we are satisfied that the verdict is not against the weight of the evidence (see, CPL 470.15 [5]).
A police officer was permitted to testify, over objection, that he observed the defendant engage in two prior uncharged drug transactions. The trial court admitted this evidence on the limited issue of the defendant’s intent to sell. However, the defendant’s intent was clearly inferable from his commission of the charged sale in plain view of the police officer (see, Penal Law § 220.00 [1]; People v Caviness, 170 AD2d 615, 616). Since evidence of the prior transactions was unnecessary to prove the defendant’s intent, the prejudicial value of this evidence outweighed its probative value and the court erred in *833admitting it (see, People v Hernandez, 71 NY2d 233, 242; People v Molineux, 168 NY 264). However, in view of the overwhelming evidence of the defendant’s guilt, the limited extent of the improper testimony, and the court’s extensive instructions to the jury concerning the limited purpose of the evidence of the uncharged crimes, we find this error to be harmless (see, People v Crimmins, 36 NY2d 230; People v Carr, 157 AD2d 794). Bracken, J. P., Harwood, Lawrence and O’Brien, JJ., concur.