Relying on a GPS device placed in a decoy pill bottle, police officers tracked an armed man suspected of robbing a pharmacy on Friday afternoon and fatally shot him during a confrontation on the Upper East Side, police officials said.

The decoy bottle was among a cache of drugs taken in an armed robbery about 1:30 p.m. from HealthSource Pharmacy, at Second Avenue and East 68th Street, according to a police official, who was not authorized to speak about the investigation.

The suspect, identified by the police as Scott Kato, 45, of Mount Vernon, N.Y., was believed to have robbed pharmacies in New York City on at least four occasions since 2011, three times at the HealthSource drugstore. He served about 12 years in prison for a 1990 conviction for sexual abuse and robbery and spent an additional 16 months in prison after violating parole twice, according to state records.

The police official said the GPS device helped lead the police to the man, who was confronted as his 2007 Jeep was stuck in traffic on a service road beneath the Franklin D. Roosevelt Drive at East 96th Street. As officers closed in, the man pointed a handgun in the direction of at least one of the officers; one or more of the officers opened fire, killing the man, the police said.