FLATBUSH, Brooklyn — Adonis Barnett, who was just 16 years old when he fatally shot another man from behind, was convicted Thursday of the “cold-blooded” attack.

“This defendant took the life of an innocent father as he walked away,” Brooklyn District Attorney Eric Gonzalez said. “This cold-blooded killing left a family heartbroken, and today’s conviction ensures that the defendant will spend many years behind bars.”

Barnett, now 22, shot 38-year-old Gerald Cummings on Aug. 3, 2016, according to the investigation. Cummings had confronted Barnett and another member of Barnett’s game about 10:18 p.m., near a basketball court outside of P.S. 6, about stealing a baseball hat from his son. The distinctive Oakland Raiders cap was valued at several hundred dollars.

Witnesses saw Barnett and a friend, who was wearing the stolen cap. Cummings’ 17-year-old son also saw the pair, and called his father for assistance retrieving it. Cummings did get the hat back for his son, but, as he walked away, Barnett took out a gun and fired three times, hitting Cummings twice.

Cummings died at a hospital.

Following his conviction of first-degree manslaughter, Barnett faces up to 25 years in prison. He’s due to be sentenced May 26. He has also been convicted of second-degree criminal possession of a gun.