A teenager has been arrested after he allegedly fatally shot his 16-year-old friend while celebrating a video game victory.

Police say that the incident happened around 9:30 p.m. Thursday evening inside a second-floor apartment on Miller Avenue in East New York. Victim Denzil Nash, his friend Luigi Fontin, 18, and the 15-year-old suspect, whose name has not been released, were smoking pot and playing Madden NFL video game together at the time.

The suspect allegedly took out a loaded .32-caliber revolver after scoring a touchdown in the game, and waved it around, inadvertently shooting Nash in the head. The victim was taken to Brookdale Hospital, where he was pronounced dead less than an hour later.

A source told the Post that the two teens threw the gun inside a backpack before police arrived and tossed it into a bathtub; when cops arrived, they told them it had been an accident. The 15-year-old suspect has since been charged with second-degree manslaughter and criminal possession of a weapon.

One of Nash's teacher, Angela Meloni, has set up a GoFundMe page for his family to raise money for his funeral. "I write this now as one of his many teachers who are heartbroken and sickened over this loss; Denzel was a junior at our high school, a former member of the soccer team, and a beloved friend to much of the student body," she wrote on the page. "As his teachers, friends, family, or even well-meaning strangers, we want to come together to help give Denzel the proper farewell and burial that we all know he deserves."