NEW YORK — Police say an armed bandit who held up a New York City pharmacy for prescription painkillers was shot and killed during a chaotic getaway.

The shooting happened at around 11 a.m. Thursday in East Harlem.

Pharmacist Frank Wong tells The Associated Press that a man brandishing a gun burst into the store demanding Oxycontin and Percocet.

A worker hit a silent alarm that summoned police.

The masked man was shot trying to flee. Investigators say he was shot by a retired officer who was pumping gas across the street when the gunfire started.

Police identified the dead man as Rudolph Wyatt, of Harlem. He was 23.

A second suspect was still being sought.