*715Appeal by the defendant from a judgment of the Supreme Court, Queens County (Rotker, J.), rendered January 7, 2005, convicting him of criminal possession of a controlled substance in the second degree, after a nonjury trial, and imposing sentence. The appeal brings up for review the denial, after a hearing (Grosso, J.), of that branch of the defendant’s omnibus motion which was to suppress physical evidence.
Ordered that the judgment is affirmed.
At approximately 3:00 a.m. on February 14, 2004 the police heard gunshots coming from what appeared to be an abandoned store. As they approached the premises, they heard voices screaming from inside and the “racking of a pistol.” Two males wearing ski masks, one of whom was carrying a black semiautomatic pistol, exited the premises and were placed under arrest.
Once inside the premises the arresting officer noted that there were approximately 20 men inside a small room 15 by 30 feet in size, which appeared to be an illegal gambling establishment. Most of the men were lying on the ground but some were trying to leave. The arresting officer noted that the men said they were just robbed by three men — “basically they just kept saying, ‘There is a third guy and I got robbed.’ ” When the officer asked who the third robber was, no one responded. Unable to determine who the third robber was, they conducted a pat-down frisk of those present.
While frisking the defendant, the arresting officer felt a “bulge on his left front sleeve of his jacket” five inches by three inches and “pretty clumpy like something like a hard object, a clump.” The officer was not sure if it was a weapon, so he pulled it out and determined it was a plastic bag containing a while powdery substance clumped together which was later determined to be cocaine. A gun was also recovered from a “craps table.”
Clearly, a blanket search of the persons in the premises to recover narcotics would not have been permissible (see Ybarra v Illinois, 444 US 85 [1979]; People v Gomcin, 265 AD2d 493, 494 [1999]). However, the evidence established that the police were not conducting a search for narcotics, they were conducting a search for a third robber who was apparently armed and dangerous to the officers and others present (see People v Davis, 64 NY2d 1143 [1985]). The police asked who the third robber was *716and received no response. Under the unique circumstances of the instant case, the police were justified in patting down the defendant and other persons present.
• During the frisk, the officer felt a “hard object, a clump” five inches in length and three inches in width in the left front sleeve of the defendant’s jacket. He could not determine whether or not the object was a weapon. He pulled it out and determined that the object was a plastic bag containing a powdery substance clumped together, later determined to be cocaine.
Under the circumstances, the fact that the officer could not determine whether the bulge was a weapon from touch alone justified a further intrusion (see People v Johnson, 22 AD3d 371, 372 [2005]; People v Reyes, 234 AD2d 63 [1996], affd 90 NY2d 916 [1997]; People v Whitehead, 135 AD2d 997, 998-999 [1987]; People v Taylor, 123 AD2d 651 [1986]). Since the object was hidden in the sleeve of the defendant’s coat, the officer could have inferred that the defendant was attempting to disguise its identity as a weapon (see People v Johnson, supra). Therefore, the officer was justified in removing the object in light of his information that an armed robbery had occurred and a third robber possibly armed with a gun was still at large.
Contrary to the prosecution’s contention, the defendant’s challenge to the legal sufficiency of the evidence on the basis that the testimony presented by the prosecution was incredible as a matter of law is preserved for appellate review (see CPL 470.05 [2]; People v Gray, 86 NY2d 10 [1995]). However, viewing the evidence in the light most favorable to the prosecution (see People v Contes, 60 NY2d 620 [1983]), we find that it was legally sufficient to establish the defendant’s guilt beyond a reasonable doubt (see People v Gruttola, 43 NY2d 116, 122 [1977]). Moreover, upon the exercise of our factual review power, we are satisfied that the verdict of guilt was not against the weight of the evidence (see CPL 470.15 [5]). Crane, J.P., Spolzino, Krausman and Goldstein, JJ., concur.