DETROIT – A judge took an opportunity during a sentencing Tuesday morning to lecture a mother about the dangers of keeping a gun in her home with young children.

Shecolby Green's 9-year-old son shot himself with his mother's gun March 25. Detroit police said the boy found the handgun in his mother's purse and accidentally shot himself in the right hand.

Green was charged with second-degree child abuse and a felony firearms violation. She reached a deal by pleading guilty to a misdemeanor charge.

Judge Dalton Roberson sentenced Green to three years probation, but not before he lectured her about why she, or anyone, should keep a gun in his or her home, especially with young children.

Here's what the judge said:

Mrs. Green, you are a living example of why people should not have guns in their house. And I'm not saying that just to you. I say it to myself, too. I was an assistant prosecutor, and assistant United States attorney, defense lawyer and a judge for 30-some years, and I never owned a gun. And the reason I never owned a gun was because when I was a prosecutor, early in my legal career, I was trying a homicide case and there was a murder in the first degree, and the man who had been killed when these young people walked in his store to try to rob him, he tried to go for his gun and they killed. And the detective, I said to him, 'I should get me a gun.' And he said to me, 'Dalton, you don't need a gun in your house because if someone comes into your house, or contacts you on the street, if you go for the gun you end up getting killed.' There's nothing that you own that's worth you giving up your life for, and you almost gave up your child's life for it. Don't go out and buy another gun, OK? Don't let these people convince you that (you need a gun). There are societies in our country that have no guns, and believe me if we had less guns we wouldn't have all the problems we have ... with children in your house, you thought (the gun) was safe in your purse, didn't you? It wasn't."

Roberson continued by offering an example from when his son was 4 years old. He said he and his wife found the boy upstairs covered in Vasoline which was in the couple's bedroom.

"If there would have been a gun under the pillow, he'd have had it," he said.

Watch the judge's full statement above.

Green's son suffered a gunshot wound to his right hand. He was treated at the hospital and was expected to recover.

Roberson is a retired Wayne County Circuit judge who was filling in Tuesday for Judge Cynthia Gray Hathaway.

Detroit police chief supports armed homeowners

Detroit Police Chief James Craig has been outspoken about his support for homeowners arming themselves. In March, Craig said he did not consider this specific case an accident.

"The child was going into the parent's purse, possibly looking for candy, came across the weapon," said Craig. "I do support law-abiding citizens, Detroiters, to have (concealed pistol licenses), but I've also indicated, in a very strong way, the importance of training."

Watch a March 2014 interview with Craig about armed homeowners fighting back:

WATCH: Detroit police Chief Craig to gun owners: Defend your homes

MORE FROM MICHIGAN COURT: