Abdirahman Mohamed Adam and some of his buddies went to Harriet Island in St. Paul last December to goof around and shoot off a handgun, he told a judge Wednesday.

The 22-year-old St. Paul man fired the gun once. Then one of his friends took over and kept firing until the “gun clicked,” Adam recalled.

Adam assumed the click meant the gun had been emptied of bullets. The assumption cost his cousin his life.

During his plea hearing in Ramsey County District Court on Wednesday, the young man recounted what happened the night he fatally shot Mohamed Abdi Mohamud. Adam pleaded guilty to one count of second-degree manslaughter in Mohamud’s death.

He told Judge Sara Grewing that he and his friends relocated to a parking lot in St. Paul after playing with the gun at Harriet Island. He grabbed the firearm from his car and walked over to someone he knew in another vehicle and pointed it at him.

The friend got angry and told him to stop playing around, Adam recalled.

He assured him there was nothing to worry about because the gun was empty.

Then he walked back to his vehicle, where his cousin, Mohamud, was waiting in the passenger seat. Adam decided to replay the joke on him, but with a critical difference.

“I decided to make the click sound,” Adam told the judge, meaning 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.

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

Adam was emotional as he described the incident.

Assistant Ramsey County Attorney Margaret Samec told Adam that while he never meant to harm his cousin, his decision to enter a guilty plea meant he acknowledged that he should have known better.

“You never point a gun at anything you don’t intend to shoot, and you certainly don’t pull the trigger,” Samec said.

Adam will be sentenced Sept. 11.

He is expected to receive a stayed sentence and be placed on probation for 10 years.

The terms of his probation will require him to speak to students about the dangers of firearms as well as marijuana, receive a chemical-dependency assessment and attend either school or a job for at least 40 hours a week. He could also be sentenced to a year in jail.