A teenage boy is now in police custody, according to police, accused of shooting and killing a man who was trying to reclaim his son's stolen hat in Brooklyn.

Police said 16-year-old Adonis Barnett was arrested and charged Thursday with second-degree murder and criminal possession of a weapon.

Investigators said Barnett fatally shot Gerald Cummings, 38, at a basketball court near Bedford and Snyder Avenues in Flatbush on August 3.

Police said Cummings had confronted Barnett and his group of friends after he saw one of them wearing a design Don C Raiders cap they stole from his son the weekend earlier. The caps have snakeskin bills and can cost more than $400.

Cummings snatched the hat and then scuffled with one of the teens. That is when Barnett fired a gun and ran off, police said.

Police also arrested Romell Baptiste, 16, earlier this month, who they said was wearing the stolen hat alongside Barnett at the time of the shooting.