A councillor from Barnsley has been given a suspended sentence and community service after leaving two children alone and locked in a house.
Coun John Smith was given a suspended sentence by the judge
John Smith, 49, who represents the Penistone East ward, earlier admitted two charges of child abandonment.
Handing down an eight-week jail sentence suspended for 18 months Judge Patrick Robertshaw branded Smith "reckless" at Sheffield Crown Court.
After the case Smith said he should have recognised the potential hazards.
The court heard he left the two boys, both aged under 10, home alone for three hours one evening in June.
The councillor had explained he had gone out not meaning to be very long.
But the boys became frightened and rang a woman they knew who eventually went to the house.
The police were called and they broke down the door.
Inside the house there was a kitchen knife the boys could have reached and a disabled gun and four bullets in a clip.
The judge told Smith he had been "reckless, selfish, showed gross irresponsibility and had no thought to the physical safety or emotional well-being of the children for whom he had responsibility at that moment."
He added that Smith's previous good character had been taken into account on the issue of sentencing.
Speaking after the sentencing outside the court Smith said: "One (child) was asleep, the other one...I thought he would be alright. I didn't intend being as long as I was.
"I thought I was going to be about 30 minutes, he was sat down watching television and I thought he'd be fine.
"I didn't think of the potential hazards which I should have done."