The court heard Connar had been on his way to a nearby pub with his partner after attending a Golden Wedding celebration.

His girlfriend’s father then found himself caught up in the rammy, which Connar’s defence solicitor said he had nothing to do with, and had to be taken to hospital.

Police were called to the scene at around 12.30am.

Procurator fiscal depute Susan Campbell said: “They observed the accused running up behind someone who was slumped on the ground.

“The accused kicked that person on the head with force. He then turned and tried to run and police were able to take hold of him and restrain him. The man in question declined medical attention and wasn’t observed to have any injuries.”

His solicitor told Sheriff Derek Livingston that Connar has a baby and a responsible job and was caught in “a moment of madness”.

The lawyer explained: “Police were attending to Mr McLachlan because they were about to detain him.

“Police were either side of him when Connar inexplicably ran up and kicked him. The red mist descended. There is no excuse for behaving in the manner he did.”

Sheriff Livingston said: “People who kick other people in the head have to realise it’s sheer luck they don’t face a murder charge.

“You were behaving out of control. That’s your good luck in relation to matters. Otherwise you generally appear to be a person who is a good citizen.”