A New York City police officer died after he was shot in the head while chasing a gunman in East Harlem on Tuesday, the authorities said.

The officer, Randolph Holder, 33, a Guyanese immigrant and a police officer for five years, was the fourth killed in the line of duty in the past 11 months, the police commissioner, William J. Bratton, said during an emotional news conference early Wednesday. A suspect was in custody, he said.

Officer Holder and his partners were responding to reports of gunshots around 8:30 p.m. when they encountered a man riding a bicycle on East 120th Street on a pedestrian path over Franklin D. Roosevelt Drive. Gunfire was exchanged, and Officer Holder was struck in the head.

He was taken in critical condition to Harlem Hospital Center, where he was pronounced dead at 10:22 p.m., Commissioner Bratton said.