Two brothers, aged four and six, were found abandoned in the street after their mother left them alone at home to go drinking.
Single mother Demi Heffernan had been drinking when she disappeared from their home, leaving the children inside, until she returned at 1.15am after a neighbour alerted the police.
The boys aged six and four climbed out of a window at their home late at night after their mother left them "fending for themselves" for two hours.
One of the "distressed" children knocked on a neighbour's home at 12.15am after they used a chair propped against a wall to climb out of the window and into the street.
The boys could have been abducted by a stranger or a fire could have broken out while she was missing, Hull Crown Court heard.
Heffernan, 25, from Bridlington, admitted child cruelty on April 1 last year, reports Hull Live.
Richard Thompson, prosecuting, said that Heffernan had been drinking at the home of a female neighbour but, at 10.30pm, she left to put the two children to bed.
She intended to return to the neighbour's house but the woman waited for an hour for her to return and, by 11.30pm, she had not done so.
The neighbour went to investigate and could see the children in the house but she could not see Heffernan.
At 12.15am, Heffernan's six-year-old son knocked on the neighbour's door and his brother, aged four, was standing further down the road.
The woman took them into her house and, after repeatedly trying to telephone Heffernan, alerted the police at 12.30am.
The police arrived but Heffernan did not turn up until about 1.15am.
"The children were taken to be cared for by their grandparents," said Mr Thompson. "They were on their own for about two hours, maybe a little bit longer."
Heffernan was abusive towards the neighbour about the actions she took that night to safeguard the children, said Mr Thompson.
Police saw that the children had pushed a wooden chair up against a wall to allow them to climb out through a window.
"The children were tired and distressed," said Mr Thompson.
Heffernan later pretended that she had just been to her mother's house for five minutes and she was "irate" when interviewed.
She denied neglecting the boys and being under the influence of alcohol but admitted that she "had a drink".
Heffernan claimed that the woman was "simply trying to set her up" by what she said.
"[Heffernan] told some lies about what actually happened," added Mr Thompson.
Heffernan had convictions for six previous offences, including public order matters, criminal damage and drink-driving.
Michele Stuart-Lofthouse, mitigating, said that Heffernan was complying with a community order imposed by Hull magistrates in November for threatening behaviour towards the same neighbour.
It included a tagged 90-day alcohol abstinence order.
"She is remorseful," said Miss Stuart-Lofthouse.
"It's the biggest regret of her life that this incident unfolded.
"At the time of this occurring, but it's little excuse at all, she was having a number of difficulties in her life."
Heffernan had been suffering anxiety and alcohol problems while trying to look after two children.
"She is addressing her alcohol issues," said Miss Stuart-Lofthouse.
"She now appreciates the magnitude of her very poor decision-making.
"She has done all she possibly can in the meantime to get assistance and support from those around her. She hopes she can get her life back on track with the assistance that is now being given to her.
"She has had an ability in the past to work and that is something that she hopes to do again."
Any prospect of the children returning to Heffernan would depend on the court case.
Judge John Thackray QC told Heffernan: "You made the decision at 10.30pm to leave two young children fending for themselves at home, aged four and six.
"It must have been extremely frightening for them. They were described by police when they attended the scene at about 1am as distressed.
"They were seen in the street. That's the actual harm you caused.
"What would have happened if there had been a fire?" said Judge Thackray. "What would have happened if a stranger had taken one of your children?
"You waited until the CCTV had been served," said Judge Thackray.
"You knew that you were guilty and you should have pleaded guilty at that stage. I don't accept that you are remorseful or, at least, genuinely remorseful.
"If you had been remorseful, you would have pleaded guilty at an earlier stage."
Heffernan was given a 10-month suspended prison sentence and 200 hours' unpaid work.
No court orders were made in connection with the children in the case and this was later confirmed by the court.