An Ayrshire man “only just” avoided jail after he was caught by cops during what was intended to be a robbery in Irvine.

Peter Hogg, 47, who lives in the Barassie area of Troon, pleaded guilty at an earlier court hearing to a charge of being found in a private property in the town without lawful authority to do so.

The charge also said it may be reasonably inferred that he intended to commit theft, during an earlier court appearance.

Sentencing had been deferred until he appeared in the dock in Kilmarnock Sheriff Court once again on Thursday, March 23, for the crime, which he committed on August 15 last year.

As Sheriff Alistair Watson weighed up his sentence, the court was told how Hogg had broke into the address of a person who was on holiday in Turkey at the time of the offence.

However, Hogg was said to be unaware of who the homeowner was.

Addressing the accused in court last week, Sheriff Watson said it was difficult to decide whether Hogg should spend time behind bars.

He said: “You are really pushing it to the point where the court almost has to send you to jail.

“I am willing to allow you to remain in the community - but only just.”

Hogg was subsequently ordered to complete 140 hours of unpaid work which he must do within a six month period.

He was also placed under the supervision of social workers for the next 18 months. 

And Sheriff Watson made it clear what will happen to Hogg if this order was not adhered to.

He gave further warning, stating that if Hogg does not “fully comply with my order” then he “will be brought back before me and you will be going to jail”.