CHICAGO—Prosecutors in Chicago say a 17-year-old accused in his 16-year-old friend’s shooting death admitted to the killing in a Snapchat video.

The Chicago Tribune reports that Cook County Assistant State’s Attorney Anna Sedelmaier said in court Sunday that the teen posted the video on the social media app from the back of a police car. He is charged with first-degree murder in the death of Christian Bandemer, who was shot in the chest Friday on the city’s South Side.

Sedelmaier says the suspect said on Snapchat: “I killed Chris and now I’m going to kill myself.”

Snapchat videos can be viewed once then disappear. A spokeswoman for the prosecutors’ office said Monday she didn’t know how authorities accessed his video.

Defence attorney Mike Johnson described the shooting as accidental.