A dad-of-three had his children taken into foster care for three months after striking their bedroom wall with a leather belt.
Social workers removed the trio of youngsters from the family home after one of them reported the incident to a teacher.
The children, who were all under 11, have now been returned to their father who can’t be named for legal reasons.
He appeared at Edinburgh Sheriff Court on Friday and admitted behaving in a threatening or abusive manner in March this year.
The dad originally faced charges of hitting two of his children with a belt and assaulting the third but those were dropped by the Crown.
Defence agent Murray Robertson said the belt incident had “grown arms and legs” in its telling, resulting in the more serious accusations against the accused.
He said the dad had “reached pretty much the end of his tether” due to his children’s behaviour then snapped.
Fiscal depute Sarah Noon said the three youngsters had been in a bedroom at their Midlothian home when their father came in.
Ms Noon said: “He immediately took off a brown leather belt. He folded it in half and brandished it at the children.
“His demeanour was described as being angry and aggressive. He struck the belt off the bedroom wall while shouting at the children then struck the railing of a bunk bed.”
Ms Noon said one of the youngsters asked, “What was that for?” and the dad replied: “You know what for”.
The prosecutor said one of the children informed a teacher the following day about an “incident with a belt” and social services and police were contacted.
She said: “The children were removed from their father’s care. They were placed in foster care for a short period of time and have now been returned. They are living with the accused at the family address.”
Ms Noon said social workers had “no concerns” about the dad’s ability to look after his children.
Mr Robertson said his client had been “doing his best for a very long time”.
He said one of the children displayed “very challenging behaviour” and along with another sibling had gotten in trouble at school for bullying.
The solicitor said: “He went up to his children’s bedroom to ask about their behaviour. He was speaking and didn’t think he was getting through.
“He lost his composure and took off his belt.”
Mr Robertson said the three children had been recently returned to their home and they had wanted to come back.
He said it was a “sorry tale all round” and a “terrible experience” for his client.
Sheriff Norman McFadyen deferred sentence until August for reports.