Patryk Halon, 19, was fined £200 after he admitted wilfully abandoning the child and exposing him in a manner likely to cause unnecessary suffering or injury to health.
He was supposed to be looking after the child, who cannot be named for legal reasons, but went boozing instead, leaving the house unlocked, Peterhead Sheriff Court heard.
Two strangers found the boy resting on a wall outside the property in Peterhead, near a busy road and bar, in the early hours of August 5 last year (2018).
Fiscal depute Ruairdh McAlister said police later caught up with Halon and found him drinking.
Mr McAlister: “Two witnesses saw the young child sitting on a wall.
“He told them he had woken up alone and didn’t know where his family were.
“The locus is near a busy road and a licensed premises.
“The accused was traced in Peterhead and he was under the influence of alcohol.”
Defence agent Stuart Flowerdew said his client had arranged to go out socialising, believing someone else was coming to babysit the primary school pupil. However this never materialised.
Mr Flowerdew said: “Mr Halon accepts full responsibility for this and these are not the actions of an adult.”
Sheriff Christine McCrossan fined Halon of Peterhead £200.