—Appeal by the defendant from a judgment of the Supreme Court, Richmond County (Kuffner, J.), rendered October 18, 1993, convicting him of murder in the second degree, upon a jury verdict, and imposing sentence.
Ordered that the judgment is affirmed.
We agree with the defendant’s contention that the trial court erred by failing to charge that one of the People’s witnesses was an accomplice as a matter of law pursuant to CPL 60.22 (2) (b). According to the witness’s own testimony, he and the defendant attacked the victim and his friend, the defendant *690drew his gun, and the witness punched the victim at the defendant’s command. After ordering the victim to empty his pockets, the defendant shot him in the head. Given these facts, the conclusion is inescapable that the witness was a participant in the assault and attempted robbery of the victim and that he could have been charged with felony murder based upon the same facts upon which the charge of murder in the second degree against the defendant was based (see, CPL 60.22 [2] [b]; People v Torres, 160 AD2d 746; cf., People v Cody, 190 AD2d 684; People v Kretchmer, 181 AD2d 1043; People v Gjonaj, 179 AD2d 773). Nevertheless, under the facts of this case, the court’s failure to charge that the witness in question was an accomplice as a matter of law was harmless beyond a reasonable doubt (see, People v Cody, supra; People v Adams, 185 AD2d 680; People v Torres, supra; cf., People v Chernauskas, 137 AD2d 607). There was an eyewitness to the murder who identified the defendant as the perpetrator and ample corroborating evidence tending to connect the defendant with the commission of the crime. Altman, J. P., Hart, Friedmann and Krausman, JJ., concur.