A 16-year-old boy was shot and killed on Friday afternoon while playing basketball at a playground in Brooklyn, the police said.

Officers found the boy, Oluwadurotimi Joseph Oyebola, known as Timi, with a gunshot wound to his head shortly before 4 p.m. in Brownsville, the authorities said. He had been playing basketball after school with three friends at Chester Playground, which is next to Public School 396, when at least one or two people fired shots from the southern end of the park, Assistant Chief Jeffrey Maddrey told reporters.

Two males were seen fleeing south on Chester Street, the police said.

The boy was taken to Brookdale Hospital, where he was pronounced dead. The police said that they did not know the motive for the killing and that it was possible that the boy was not the target of the shooting.

Oluwadurotimi lived in Jamaica, Queens, and attended a charter school near the playground, Deputy Chief Michael Kemper said. The shots were fired more than 100 feet away from the boys, Chief Kemper said.