DETROIT – A Detroit man pleaded guilty to fatally shooting his friend while they were playing with a rifle on Instagram Live.

Dawone Cook, 18, pleaded guilty Wednesday to careless discharge of a firearm causing death. He is expected to be sentenced July 18.

ORIGINAL REPORT: Man shot, killed while livestreaming on Instagram

Prosecutors said Cook and his friend, Dylan Hemphill, also 18, were filming a live video on Instagram at about 11:55 p.m. on April 2 at a home in the 17600 block of San Juan Drive and were playing with a rifle with a bayonet. Police have said the two were showing off weapons and money in the video.

Hemphill gave the weapon to Cook, who was handling the bayonet, when the gun discharged, according to authorities.

Hemphill was shot in the head. Cook called 911, but medical officials pronounced Hemphill dead at the scene. Police called the shooting an accident.

Cook failed to appear at his arraignment on April 27, and an arrest warrant was issued. He was released May 8 after posting bond.

The misdemeanor charge has a maximum penalty of two years behind bars.