A St. Paul man will spend 180 days in jail for accidentally killing his cousin with a gun on Harriet Island last December.

A Ramsey County District judge sentenced Abdirahman Mohamed Adam during a hearing Wednesday morning, where the 22-year-old also received 10 years of probation.

Adam also will need to complete 50 hours of community service centered around educating students about the dangers of using firearms while under the influence of drugs, in addition to several other conditions.

Adams pleaded guilty to one count of second-degree manslaughter this past July.

Before entering his plea, Adams recounted for the judge what happened the night he fatally shot Mohamed Abdi Mohamud last December.

The young men and some of their buddies had gone to Harriet Island to goof around and shoot off a handgun.

Adam fired the gun once, then one of his friends took over and kept firing until the “gun clicked,” Adam recalled during the hearing.

Assuming the gun had been emptied of bullets, Adam decided to play a joke on Mohamud and pointed the gun at him.

When he pulled the trigger, the gun went off.

A single bullet hit Mohamud, 22, in the face. Adam collapsed in shock while his friends rushed Mohamud to Regions Hospital.

Mohamud died a week later, on Dec. 9, 2018.