The court heard that James hit the child on her forehead with his phone on the morning of June 4 last year.

The blow caused a “huge cut”, as described by James during a police interview, and began to bleed.

James had received a police caution for an identical offence a year prior, against a six-year-old, the court was told.

The court also heard how James had failed to complete a community order he received in 2016 for assaulting a police officer outside a nightclub. Prosecutor Liam Gregory, who took over from Mr Rendle after the sentencing was adjourned from Thursday to today, described the incident to the court.

“It seems that Mr James had been at a nightclub and was ejected by the security staff,” he said.

“He told them he had drunk two bottles of wine.”

Police were called after James began to verbally abuse the staff, and James then spat in Pc Mumford’s eye.

This offence was committed while James was also serving a 12 month sentence suspended for 24 months after he pleaded guilty to assault occasioning ABH against a former partner.

However the suspended sentence was not activated at the time and James was spared jail, sentenced to complete a community order instead.

Defending, solicitor Russell Fraser pointed to the lack of premeditation in James’ assault against the seven-year-old.

Sentencing, Judge Patricia Lees said: “He did not premeditate it but it happened against the background of a police caution.

She added: “That first caution should have served as a warning that you need to work on your temper.”

“In my judgement, this is so serious that an immediate custodial sentence is necessary.”

She added that she accepted that James was remorseful.

“Within you, you are basically a good and decent man,” she said. “It is regrettable that it has come to this.”

James was sentenced to eight months imprisonment for assault occasioning ABH against the child.

He was also sentenced to two months imprisonment for the 2016 assault against a police officer to be served consecutively.

He will spend the second half of his sentence on licence during which he must attend anger management classes.